当我重复这里的步骤时: 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/