How to check / cancel a azure storage container delete operation

Viewed 286

I know Azure Storage works with soft deletes using GC. So I want to check if a container has the delete flag and cancel this delete operation.

However, I can't figure out a way to check if the container has the delete flag.

I did check the delete container operation in the DOCs here:

https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobserviceclient?view=azure-python#delete-container-container--lease-none----kwargs-

There is a lease paramater and the description says:

If specified, delete_container only succeeds if the container's lease is active and matches this ID. Required if the container has an active lease.

Thus, I though if I acquire a new lease, I would be able to cancel the delete operation. But I can't aquire a new lease or break the existing one. I am always receiving the following error message:

ResourceNotFoundError: The specified container does not exist.

However, when I try to create the container, it gives me the following error:

ResourceExistsError: The specified container is being deleted. Try operation later.

How can I check if there is a delete flag in a container?

How can I change the lease of a container flagged with it?

1 Answers

No, you cannot cancel the deletion of blob container, and there is no such flag.

You can request this feature in azure blob storage user feedback.

And one more thing, the only way to cancel deletion of blob container(I think it should be recovery in your case), you should contact Microsoft in time by following this guides, but no guarantee.

Related