immutableStorageWithVersioning enabled even though policy is removed

Lukáš Vaško 40 Reputation points
2026-01-26T20:38:36.8033333+00:00

Hello,

I setup a WORM on my storage account with immutability policy and later I deleted it. It was never locked because of testing purposes. It was enabled on storage account level and few blobs were created there. Now I removed policy but I'm still not able to delete a storage account.

What should I do to be able to delete it?

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
{count} votes

Answer accepted by question author
  1. Thanmayi Godithi 6,245 Reputation points Microsoft External Staff Moderator
    2026-01-27T00:23:59.4566667+00:00

    Hi @Lukáš Vaško,

    Thank you for confirming and for sharing the exact CLI error, this behavior is expected and aligns with how version-level immutability (ImmutableStorageWithVersioning) works in Azure Blob Storage.

    Although the immutability policy was unlocked and deleted, the key point is that:

    This is explicitly documented by Microsoft:

    “Version-level immutability cannot be disabled after it is enabled on the storage account, although unlocked policies can be deleted.”

    Because of this:

    The storage account still has ImmutableStorageWithVersioning enabled

    Azure blocks deletion of containers that are not empty

    “Not empty” includes:

    1. Current blobs
    2. All blob versions
    3. Snapshots (if any)

    That is why the following command fails:

    az storage container-rm delete --name <container> --storage-account <account>
    

    with:

    (ContainerProtectedFromDeletion)
    The storage account container is protected from deletion due to ImmutableStorageWithVersioning
    

    Azure enforces this protection before container deletion, regardless of whether an immutability policy currently exists.

    To delete the storage account, the following sequence is required:

    1.Delete all blobs from each container

    • This must include all blob versions, not just the latest version
    • If versioning was enabled, older versions continue to exist and block deletion

    2.Delete the containers

    • Once a container has zero blobs, versions, and snapshots, container deletion will succeed

    3.Delete the storage account

    This requirement is also documented:

    User's image

    Refer: Configure immutability policies for blob versions

    Kindly let us know if the above helps or you need further assistance on this issue.

    If the answer is helpful, please "Accept the answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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