Enable soft delete for blobs

Blob soft delete protects an individual blob and its versions, snapshots, and metadata from accidental deletes or overwrites by maintaining the deleted data in the system for a specified period of time. During the retention period, you can restore the blob to its state at deletion. After the retention period has expired, the blob is permanently deleted. For more information about blob soft delete, see Soft delete for blobs.

Blob soft delete is part of a comprehensive data protection strategy for blob data. To learn more about Microsoft's recommendations for data protection, see Data protection overview.

Note

Blob soft delete can also protect blobs and directories in accounts that have the hierarchical namespace feature enabled. Blob soft delete for accounts that have the hierarchical namespace feature enabled is currently in public preview, and is available globally in all Azure regions.

Blob soft delete is disabled by default for a new storage account. You can enable or disable soft delete for a storage account at any time by using the Azure portal, PowerShell, or Azure CLI.

Enable blob soft delete

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

  1. In the Azure portal, navigate to your storage account.
  2. Locate the Data Protection option under Blob service.
  3. In the Recovery section, select Turn on soft delete for blobs.
  4. Specify a retention period between 1 and 365 days. Microsoft recommends a minimum retention period of seven days.
  5. Save your changes.

Screenshot showing how to enable soft delete in the Azure portal

Enable blob soft delete (hierarchical namespace)

Blob soft delete can also protect blobs and directories in accounts that have the hierarchical namespace feature enabled on them.

Important

Soft delete in accounts that have the hierarchical namespace feature enabled is currently in PREVIEW, and is available globally in all Azure regions. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.

To enroll in the preview, see this form.

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

  1. In the Azure portal, navigate to your storage account.
  2. Locate the Data Protection option under Data Management.
  3. In the Recovery section, select Enable soft delete for blobs.
  4. Specify a retention period between 1 and 365 days. Microsoft recommends a minimum retention period of seven days.
  5. Save your changes.

Screenshot showing how to enable soft delete in the Azure portal in accounts that have a hierarchical namespace.

Next steps