简体   繁体   中英

Error while permanent deleting soft deleted blob through rest API

Please help with error PermanentDeleteNotSupportedOnRootBlob

I generated SAStoken for BLOB with all permissions including Delete & Permanent Delete

While making API call using below blog https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob

request url: "https://[SAS URL]&deletetype=permanent"

Getting 409 error as "PermanentDeleteNotSupportedOnRootBlob" 响应错误

x-ms-delete-snapshots in the header is "include"

Storage Account - 'Permanent Delete soft deleted blobs' option is enabled在此处输入图像描述

Google does not return anything for 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.

在此处输入图像描述

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

Note :

  1. Make sure the versionId is given correctly.
  2. For already existing blob, disable soft delete, undelete the blobs then enable all the above mentioned properties and delete again.

Otherwise one may come across 409 error.

在此处输入图像描述

Reference : Delete Blob (REST API) -permanent-delete Azure Storage | Microsoft Learn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM