azure - 使用 SAS 将 Azure SQL DB 导出到 Blob 的正确方法是什么?

标签 azure azure-cli

当我重复这里的步骤时: https://learn.microsoft.com/en-us/cli/azure/sql/db?view=azure-cli-latest#az-sql-db-export

StorageAccessKey 工作正常。

SharedAccessKey 失败并显示:

Operation failed with status: 'Bad Request'. Details: There was an error that occurred during this operation : 'Error encountered during the service operation. ; Exception Microsoft.SqlServer.Management.Dac.Services.ServiceException:Unexpected exception encountered while retrieving metadata for blob 'https://satest.blob.core.windows.net/backup/mydb-2019-5-13-10-1.bacpac'.; Inner exception Microsoft.WindowsAzure.Storage.StorageException:The remote server returned an error: (403) Forbidden.; Inner exception System.Net.WebException:The remote server returned an error: (403) Forbidden.; '

我错过了什么?

最佳答案

Microsoft.SqlServer.Management.Dac.Services.ServiceException:Unexpected exception encountered while retrieving metadata for blob

从错误消息来看,您似乎还需要共享访问签名 (SAS) 中的读取权限。请重新生成具有读取写入权限的SAS。

az storage blob generate-sas --account-name myAccountName -c myContainer -n myBacpac.bacpac \ --permissions rw --expiry 2020-01-01T00:00:00Z

关于azure - 使用 SAS 将 Azure SQL DB 导出到 Blob 的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56109801/

相关文章:

c# - 2 个存储帐户之间的 Azure CloudBlob StartCopy 方法 - 404 错误

Azure DevOps服务器: Why does a current version of ADS require a patch for a prior version of ADS?

azure - Sitecore 8.1 : Steps for converting the Lucene Search to Solr

rest - 使用 REST API 获取 Azure API 管理 SKU

SQL Azure : Executing SQL directly; no cursor

azure - 将 Azure Web App 诊断日志设置添加到 ARM 模板

azure - 在 Azure key 保管库 secret 中设置过期时间

azure - 使用 azure cli 调整 azure 中的 vmss 大小

azure - 如何使用不同的标签无缝标记 Azure 资源

azure - 使用 Azure CLI 将 SSL 证书从 KeyVault 绑定(bind)到 webapp