使用PowerShell将bacpac导出到Azure存储帐户

问题描述 投票:0回答:1

我正在尝试创建一个powershell脚本,将Azure上的SQL数据库备份到存储帐户,如下所示,

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

这是我正在关注的文件,

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

我假设以下,

$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

请告知需要传递的参数。

powershell azure-devops azure-sql-database
1个回答
1
投票

请告知需要传递的参数。

  • StorageKey:指定存储帐户的访问密钥。
  • StorageKeyType:指定存储帐户的访问密钥类型。 此参数的可接受值为: StorageAccessKey。此值使用存储帐户密钥。 SharedAccessKey。此值使用共享访问签名(SAS)密钥。

有关更多详细信息,请参阅此link

© www.soinside.com 2019 - 2024. All rights reserved.