0
votes

I'm trying to export a Azure Sql database to a Azure storage with Powershell cmdlet New-AzureRmSqlDatabaseExport but can't seem to figure out how to use the -StorageKeyType = "SharedAccessKey" option where one is supposed enter Shared Access Signature (SAS) key for the -StorageKey parameter. It is not the SAS token, is it parts of this token or how does one find the correct key format?

2

2 Answers

1
votes

Turns out it was the SaS token returned by New-AzureStorageContainerSASToken after all and format should include "?."

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.sql.models.exportrequest?view=azure-dotnet

-StorageKeyType "SharedAccessKey" -StorageKey "?xxxxxxxxxxxxxxxx"

0
votes

Below an example of how to use the StorageKeyType:

New-AzureRmSqlDatabaseExport -ServerName "xxxxx" -AuthenticationType Sql
-AdministratorLogin "xxx@xxxxx" -DatabaseName "xxxxx"
-StorageUri "xxxxxxx.blob.core.windows.net/xxxxx";
-StorageKey "xxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==" 
–ResourceGroupName "Default-SQL-SoutheastAsia" –StorageKeytype "StorageAccessKey" 

On the ServerName do not use the fully qualified name if you receive any errors.