0

I'm trying to create a powershell script to backup a SQL database on Azure to a storage account as below,

$exportRequest = New-AzureRmSqlDatabaseExport -ResourceGroupName 
$ResourceGroupName -ServerName $ServerName `
-DatabaseName $DatabaseName -StorageKeytype $StorageKeytype -StorageKey 
$StorageKey -StorageUri $BacpacUri `
-AdministratorLogin $creds.UserName -AdministratorLoginPassword $creds.Password

This is the document i'm following,

https://learn.microsoft.com/en-us/azure/sql-database/sql-database-export

I assume the following,

$ResourceGroupName - my azure resource group
$ServerName - db server name
$DatabaseName - database name
**$StorageKeytype - NOT SURE WHAT VALUE SHOULD BE PLACED HERE**
**$StorageKey - I'm hoping this is one of the access keys under the azure storage account**
$BacpacUri - Azure storage account bacpac URI path

Please advice what parameters need to passed here.

1 Answer 1

1

Please advice what parameters need to passed here.

  • StorageKey : Specifies the access key for the storage account.

  • StorageKeyType: Specifies the type of access key for the storage account.

    The acceptable values for this parameter are:

    StorageAccessKey. This value uses a storage account key.

    SharedAccessKey. This value uses a Shared Access Signature (SAS) key.

For more details, refer to this link.

Sign up to request clarification or add additional context in comments.

7 Comments

Thank you for replying Joy. Can you give me one example of what should be the value for the StorageKey Type. From my azure storage account, where should i be looking for this value?
@AryanM Just use StorageAccessKey for the value of StorageKeyType.
I have updated my question with the snapshot of the AccessKey for my storage account on Azure. So, i suppose that will be my storageKey. If yes, what will be my storageKey Type?
@AryanM The StorageKeyType just allows two values, in this case, specify the StorageKeyType with StorageAccessKey. Also, i recommend you to hide the sensitive information of your storage account in your question.
Thank you mate. Got it now.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.