When I'm trying to run the command New-AzureRmSqlDatabaseExport
in an PowerShell Runbook it fails with the error message:
New-AzureRmSqlDatabaseExport : Object reference not set to an instance of an object.
I have verified that all modules are updated, AzureRM.Sql
has version 4.12.1 when I'm writing this. New-AzureRmSqlDatabaseExport
is a part of AzureRM.Sql
and is also available in the runbook editor.
What I'm missing?
Update: The code I'm trying to run looks something like this:
$exportRequest = New-AzureRmSqlDatabaseExport -ResourceGroupName "MyResourceGroup" -ServerName "MyServerName" -DatabaseName "MyDatabaseName" -StorageKeytype StorageAccessKey -StorageKey "MyStorageKey" -StorageUri "https://mystorage.blob.core.windows.net/backupdb/db.bacpac" -AdministratorLogin "userName" -AdministratorLoginPassword (ConvertTo-SecureString "mypassword" -AsPlainText -Force)
It does work Azure Cloud Shell.