通过rest API永久删除软删除的blob时出错

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

请帮助解决错误 PermanentDeleteNotSupportedOnRootBlob

我为 BLOB 生成了 SAStoken,具有所有权限,包括删除和永久删除

使用下面的博客进行 API 调用时 https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob

请求网址: “https://[SAS URL]&deletetype=permanent”

收到 409 错误“PermanentDeleteNotSupportedOnRootBlob” responeerror

标头中的 x-ms-delete-snapshots 为“include”

存储帐户 - 启用“永久删除软删除的 blob”选项 enter image description here

Google 不会为 PermanentDeleteNotSupportedOnRootBlob 返回任何内容

还尝试使用两种签名方法作为帐户密钥和用户委托密钥并得到相同的错误

azure azure-blob-storage blobstorage sas-token http-status-code-409
1个回答
1
投票

我尝试在我的环境中重现相同的内容。

要永久删除 blob ,

their snapshot must also be soft deleted
为此,请确保在创建时启用 blob 的版本控制。

enter image description here

如果已经创建,您可以从数据保护配置中启用版本。

enter image description here

https://xxxx.blob.core.windows.net/container/blob?sp=r&st=2023-01-27T12:43:35Z&se=2023-01-27T20:43:35Z&spr=https&sv=2021-06-08&sr=b&sig=xxxx%3D&deletetype=permanent

该blob可以成功删除

注意

  1. 确保正确给出 versionId。
  2. 对于已经存在的 blob,禁用软删除,取消删除 blob,然后启用所有上述属性并再次删除。

否则可能会遇到409错误。

enter image description here

参考删除 Blob(REST API)-永久删除 Azure 存储 |微软学习

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