简体   繁体   中英

Export bacpac to a Azure storage account using powershell

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://docs.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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM