Cannot delete a container with an immutable policy but no blobs in it (Azure Portal)

besian 0 Reputation points
2024-12-12T13:47:09.2+00:00

Hi

I created a Container Immutable policy for 1 day and locked it. There were blobs in it and after 1 day the immutability expired and I deleted all the blobs, there are only folders in the container. Now I cannot delete the folders or the container because of the policy.

As I understood the documentation if there are no blobs in the container I should be able to delete it.

p.s. Soft-delete was 7days and that passed also.

Any clues?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,020 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 14,881 Reputation points MVP
    2024-12-12T16:26:26.3566667+00:00

    Hello @besian

    Thanks for using Q&A forum.

    Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

    DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default?api-version=2023-05-01


    If the Answer is helpful, please click Accept Answer and Up-Vote, so that it can help others in the community looking for help on similar topics.


  2. Hari Babu Vattepally 1,365 Reputation points Microsoft Vendor
    2024-12-12T16:38:37.1133333+00:00

    Hi @besian

    Welcome to Microsoft Q&A Forum. Thanks for posting your query here!

    We see that you we're not able to delete the folders or container because of the policy though the Immutable blob storage access policy expired.

    If the Access policy is not deleted or policy is in Lock state even though the immutability policy expired, you may not be able to delete the folders or the containers. To resolve this, check if the immutability policy can be modified or deleted. If the policy is still active, you may need to unlock it or remove it before you can delete the container or its folders, you need to delete the policy you uploaded using the context menu, next delete the container(s), then finally you can delete the storage account.

    If you are still unable to delete the container and its folders, you can try using Azure Storage Explorer or Azure PowerShell to delete the container. These tools may be able to bypass any policies that are preventing the deletion.

    There is a similar thread discussion in the Q&A forum, please refer to the suggestion and let me know the status.

    I hope this helps! Let me know in the comments if you have further questions. Comment is the fastest way to reach the experts for any questions or help you need.

    Please don’t forget to Accept Answer and hit Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members for remediation for similar issues.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.