Enable soft delete on Azure file shares

Azure Files offers soft delete for file shares so that you can more easily recover your data when it's mistakenly deleted by an application or other storage account user. To learn more about soft delete, see How to prevent accidental deletion of Azure file shares.

Applies to

File share type SMB NFS
Standard file shares (GPv2), LRS/ZRS Yes No
Standard file shares (GPv2), GRS/GZRS Yes No
Premium file shares (FileStorage), LRS/ZRS Yes No

Prerequisites

Getting started

The following sections show how to enable and use soft delete for Azure file shares on an existing storage account:

  1. Sign into the Azure portal.

  2. Navigate to your storage account and select File shares under Data storage.

  3. Select Enabled next to Soft delete.

  4. Select Enabled for Soft delete for all file shares.

  5. Select File share retention period in days and enter a number of your choosing.

  6. Select Save to confirm your data retention settings.

    Screenshot of the storage account soft delete settings pane. Highlighting the file shares soft delete section, enable toggle, set a retention period, and save. This will enable soft delete for all file shares in your storage account.

Restore soft deleted file share

To restore a soft deleted file share:

  1. Navigate to your storage account and select File shares.

  2. On the file share blade, enable Show deleted shares to display any shares that have been soft deleted.

    This will display any shares currently in a Deleted state.

    If the status column, the column next to the name column, is set to Deleted, then your file share is in a soft deleted state. And will be permanently deleted after your specified retention period.

  3. Select the share and select undelete, this will restore the share.

    You can confirm the share is restored since its status switches to Active.

    If the status column, the column next to the name column, is set to Active, then your file share has been restored.

Disable soft delete

If you wish to stop using soft delete, follow these instructions. To permanently delete a file share that has been soft deleted, you must undelete it, disable soft delete, and then delete it again.

  1. Navigate to your storage account and select File shares under Data storage.

  2. Select the link next to Soft delete.

  3. Select Disabled for Soft delete for all file shares.

  4. Select Save to confirm your data retention settings.

    Disabling soft delete will allow you to immediately and permanently delete all file shares in your storage account at your leisure.

Next steps

To learn about another form of data protection and recovery, see our article Overview of share snapshots for Azure Files.