Enable and manage soft delete for containers (preview)

Container soft delete (preview) protects your data from being accidentally or erroneously modified or deleted. When container soft delete is enabled for a storage account, a container and its contents may be recovered after it has been deleted, within a retention period that you specify.

If there is a possibility that your data may accidentally be modified or deleted by an application or another storage account user, Microsoft recommends turning on container soft delete. This article shows how to enable soft delete for containers. For more details about container soft delete, including how to register for the preview, see Soft delete for containers (preview).

For end-to-end data protection, Microsoft recommends that you also enable soft delete for blobs and Blob versioning. To learn how to also enable soft delete for blobs, see Enable and manage soft delete for blobs. To learn how to enable blob versioning, see Blob versioning.

Enable container soft delete

You can enable or disable container soft delete for the storage account at any time by using either the Azure portal or an Azure Resource Manager template.

To enable container soft delete for your storage account by using Azure portal, follow these steps:

  1. In the Azure portal, navigate to your storage account.
  2. Locate the Data Protection settings under Blob service.
  3. Set the Container soft delete property to Enabled.
  4. Under Retention policies, specify how long soft-deleted containers are retained by Azure Storage.
  5. Save your changes.

Screenshot showing how to enable container soft delete in Azure portal

  1. Specify the retention period. The default value is 7.
  2. Save the template.
  3. Specify the resource group of the account, and then choose the Review + create button to deploy the template and enable container soft delete.

View soft-deleted containers

When soft delete is enabled, you can view soft-deleted containers in the Azure portal. Soft-deleted containers are visible during the specified retention period. After the retention period expires, a soft-deleted container is permanently deleted and is no longer visible.

To view soft-deleted containers in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal and view the list of your containers.

  2. Toggle the Show deleted containers switch to include deleted containers in the list.

    Screenshot showing how to view soft deleted containers in the Azure portal

Restore a soft-deleted container

You can restore a soft-deleted container and its contents within the retention period. To restore a soft-deleted container in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal and view the list of your containers.

  2. Display the context menu for the container you wish to restore, and choose Undelete from the menu.

    Screenshot showing how to restore a soft-deleted container in Azure portal

Next steps