Azure Export SQL database example
It appears that the database name is case sensitive when using az sql db export. Correcting the casing on the database name and resource group solved this issue in my case.
The PowerShell script example in your question above is tested working as expected for me.
However, I am not able to reproduce the same error message as yours even try to use non-existent resource group, database server or database.
Important Note:
- For
$serverAdmin
and$serverPassword
, their values should be single-quoted instead of double-quoted for the script to work - Check the version of your
AzureRm.Sql
module. Mine tested working is 2.5.0 - Try to use -Debug for your
New-AzureRmSqlDatabaseExport
command line to see the details
This has just come out from MS/Azure and helps greatly with DB Export.
https://github.com/Microsoft/sql-server-samples/tree/master/samples/manage/azure-automation-automated-export