I tried many times with the following commands:
$Credential = Get-Credential
$SqlContext = New-AzureSqlDatabaseServerContext -ServerName $ServerName -Credentials $Credential
$StorageContext = New-AzureStorageContext -StorageAccountName $StorageName -StorageAccountKey $StorageKey
$Container = Get-AzureStorageContainer -Name $ContainerName -Context $StorageContext
$exportRequest = Start-AzureSqlDatabaseExport -SqlConnectionContext $SqlContext -StorageContainer $Container -DatabaseName $DatabaseName -BlobName $BlobName
But when creates a server connection context with New-AzureSqlDatabaseServerContext
, the message says the server was not found or was not accessible:
New-AzureSqlDatabaseServerContext : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that S
QL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
At line:1 char:8
+ $Con = New-AzureSqlDatabaseServerContext -ServerName "derekserver" -C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureSqlDatabaseServerContext], SqlException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.NewAzureSqlDatabaseServerContext
So basically we can speculate New-AzureSqlDatabaseServerContext
doesn't work with Azure Resource Manager SQL databases.
And no ARM cmdlets with the same function found for now.