Azure container soft delete lets you recover a deleted container and its contents during a configured retention period. It complements blob soft delete, which protects individual deleted blobs.
Prepare a safe test
Use a storage account you are authorized to configure and a disposable container with a sample file. Never use a production container for the deletion test. Restoring a container requires a role such as Storage Blob Data Contributor.
Enable protection
- Open the storage account in Azure portal.
- Go to Data management > Data protection.
- Select Enable soft delete for containers.
- Choose a retention period from 1 to 365 days. Microsoft recommends at least seven days.
- Select Save, then revisit the page to verify the saved setting.
Test recovery
- After confirming protection is enabled, delete only the disposable test container.
- Open the account’s container list and enable Show deleted containers.
- Open the deleted container’s context menu and select Undelete before retention expires.
- Open the restored container and check that the sample file is available and readable.
Know what it protects
Containers must be restored under their original names; reusing that name blocks recovery. Retention changes apply to future deletions, not containers already deleted. Expired containers are permanently removed.
Container soft delete does not protect the storage account from deletion or restore a single deleted blob inside an undeleted container. Pair it with appropriate blob protection and consider a resource delete lock for the account.


