Hi @Thanos Chanias ,
Thanks for reaching out to Microsoft Q&A.
Immutability settings prevent resources like storage accounts from being deleted, which is likely what you're encountering here.
To delete the resource group and subscription, you must first remove the immutability protection applied to the storage account’s containers. When containers have a locked immutability policy, Azure prevents deletion of blobs, containers, and the storage account itself, which in turn blocks resource group deletion.
Permissions: Make sure you have sufficient permissions to remove immutability settings (like being an Owner or User Access Administrator).
Audit Logs: If you're unsure how these settings were applied, checking the audit logs in the Azure Portal can provide insights into changes made.
Update:
Thanks for the confirmation. Glad the issue is resolved.
I am summarizing and posting the answer.
Being a subscription or resource owner is not sufficient to delete blobs protected by immutability. You must explicitly grant yourself the Storage Blob Data Owner role on the storage account.
Resolution:
- Assign Required Role
- Go to the Storage Account in Azure Portal.
- Open Access Control (IAM).
- Grant yourself the Storage Blob Data Owner role.
- Wait a few minutes for role assignment to propagate.
- Delete Blobs in Locked Containers
- Navigate to Containers under the storage account.
- For each container listed in the error:
- Open the container.
- Select all blobs (selecting at the first level is sufficient).
- Delete the blobs.
- If deletion is blocked due to immutability retention, ensure the retention period has expired (locked policies cannot be bypassed before expiry).
- Delete the Containers
- After deleting all blobs, delete the container itself.
- Repeat the process for each affected container.
- Ignore System Containers
- System containers such as $logs do not need manual deletion.
- They will be removed automatically when the storage account is deleted.
- Delete the Storage Account
- Once all protected containers are removed, delete the Storage Account.
- Delete the Resource Group
- After the storage account is deleted, retry deleting the Resource Group.
- You should now be able to proceed without the
ResourceGroupDeletionBlockederror.
Hope this helps!