Given Microsoft is deprecating the previous method of exporting a SQL DB they have put up a suggested example here:
$subscriptionId = \"YOUR AZURE SUBSCRIPT
Seems really stupid but the error for me was because my "DatabaseName" parameter was case sensitive.
I was sending in the value "database" but the actual database name was "Database"
seems crazy but might help someone out