TIP

👊 that ⭐️ button on the official GitHub repo (opens new window) to stay up to date.

💡 Learn more : Soft delete for Azure Storage (opens new window).

This post was brought to you by Kumar Allamraju (opens new window).

# How to restore accidental deletion of your Azure Storage Blobs

# Soft delete for Azure Storage Blobs

Azure Storage offers soft delete for blob objects so that you can more easily recover your data when it is erroneously modified or deleted by an application or other storage account user. When turned on, soft delete enables you to save and recover your data where blobs or blob snapshots are deleted. This protection extends to blob data that is erased as the result of an overwrite.

# Enable Soft delete feature in Azure Storage

  1. Create a Storage Container inside the Storage account.

  2. Go to Soft delete under Blob service section

  1. Enable the "Soft delete" option. By default it's disabled and the retention policy is 7 days. You can increase the retention period up to 365 days.
  1. Go back to your storage container and upload some files.
  1. To validate the "Soft delete" feature, delete the uploaded files.
  1. Under your Storage container, check the "Show deleted blobs" option. It will show all the previously deleted blobs.
  1. Click on the "context menu" (extreme right) and select the "Undelete" option.
  1. This will put the deleted blob file(s) back in "Active" state as shown below.

# Conclusion

Azure Storage offers soft delete for blob objects so that you can more easily recover your data when it is erroneously modified or deleted by an application or other storage account user. We encourage you to explore this Azure tip to restore/recover the deleted blobs.

Don't forget to learn more about Soft delete for Azure Storage blobs on our docs (opens new window).