[英]Error while permanent deleting soft deleted blob through rest API
Please help with error PermanentDeleteNotSupportedOnRootBlob请帮助解决错误 PermanentDeleteNotSupportedOnRootBlob
I generated SAStoken for BLOB with all permissions including Delete & Permanent Delete我为 BLOB 生成了 SAStoken,具有所有权限,包括删除和永久删除
While making API call using below blog https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob使用以下博客 API 进行调用时 https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob
request url: "https://[SAS URL]&deletetype=permanent"请求 url:“https://[SAS URL]&deletetype=permanent”
Getting 409 error as "PermanentDeleteNotSupportedOnRootBlob"获取 409 错误作为“PermanentDeleteNotSupportedOnRootBlob”
x-ms-delete-snapshots in the header is "include" header 中的 x-ms-delete-snapshots 是“include”
Storage Account - 'Permanent Delete soft deleted blobs' option is enabled存储帐户 - 启用“永久删除软删除 blob”选项
Google does not return anything for PermanentDeleteNotSupportedOnRootBlob Google 不会为 PermanentDeleteNotSupportedOnRootBlob 返回任何内容
Also tried with both Signing method as Account key & User delegation key and got same error还尝试将签名方法作为帐户密钥和用户委托密钥并得到相同的错误
I tried to reproduce the same in my environment.我试图在我的环境中重现相同的内容。
To permanently delete blob, their snapshot must also be soft deleted
For that Make sure to enable versioning for blobs while creating.要永久删除 blob,
their snapshot must also be soft deleted
为此确保在创建时为 blob 启用版本控制。
If already created, you can enable version from data protection configuration.如果已经创建,您可以从数据保护配置中启用版本。
With和
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
The blob can be deleted successfully可以成功删除blob
Note :
注意:
- Make sure the versionId is given correctly.
确保正确给出了 versionId。
- For already existing blob, disable soft delete, undelete the blobs then enable all the above mentioned properties and delete again.
对于已经存在的 blob,禁用软删除,取消删除 blob,然后启用所有上述属性并再次删除。
Otherwise one may come across 409 error.否则可能会遇到 409 错误。
Reference : Delete Blob (REST API) -permanent-delete Azure Storage |参考: 删除 Blob (REST API) -permanent-delete Azure 存储 | Microsoft Learn
微软学习
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.