แก้ไข

แชร์ผ่าน


How to enable soft delete on Azure file shares

Azure Files offers soft delete for file shares so that you can 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 Yes

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 in to the Azure portal.

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

  3. Select Disabled next to Soft delete. The Soft delete settings pane will appear.

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

  5. Under File share retention period in days, use the slider to specify a number between 1 and 365 days.

  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 want to stop using soft delete, follow these instructions. To permanently delete a file share that's been soft deleted, you must undelete the share, disable soft delete, and then delete the share again.

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

  2. Select Enabled next to Soft delete. The Soft delete settings pane will appear.

  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.

Next step

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