Learn how to implement Soft Delete for Azure Files


Implementing soft delete for Azure Files protects your file shares by allowing you to recover deleted files or file shares within a specified retention period.

Here's how to enable and configure soft delete for Azure Files.

Steps to Implement Soft Delete for Azure Files

Using Azure Portal

1. Navigate to the Storage Account

  • Log in to the .

  • Go to the Storage Accounts section and select the storage account where your file shares reside.

2. Access File Share Settings

  • Under the selected storage account, go to Data protection in the left-hand menu.

3. Enable Soft Delete

  • In the File Share section of Data Protection, find the Soft delete for Azure Files option.

  • Toggle it to Enabled.

4. Set the Retention Period

  • Specify the number of days (1–365 days) you want the deleted data to be retained.

5. Save Changes

  • Click Save to apply the configuration.

Using Azure PowerShell

1. Install/Update Azure PowerShell

Ensure the Azure PowerShell module is installed and updated:

2. Log in to Azure

3. Enable Soft Delete

Use the following command to enable soft delete and set a retention period:

Using Azure CLI

1. Install/Update Azure CLI

Ensure Azure CLI is installed and updated:

2. Log in to Azure

3. Enable Soft Delete

Run the following command to enable soft delete and set the retention period:

Using Azure REST API

Use the Set File Service Properties API to enable soft delete and specify the retention period.

Refer to Azure's REST API documentation for details.

Recovering Deleted File Shares

1. In Azure Portal

  • Go to the storage account.

  • Under File shares, select Deleted file shares.

  • Locate the file share you want to restore and click Restore.

2. Using Azure CLI or PowerShell

Use the respective commands to list deleted shares and restore them.

Summary

  • Soft delete incurs additional costs based on the data retained during the retention period.

  • Once the retention period expires, the deleted data is permanently removed and cannot be recovered.

  • Soft delete protects entire file shares; to enable recovery for individual files, use Share Snapshots.

By enabling soft delete, you add an extra layer of data protection for accidental or malicious deletions.

Related Articles


Rajnish, MCT

Leave a Reply

Your email address will not be published. Required fields are marked *


SUBSCRIBE

My newsletter for exclusive content and offers. Type email and hit Enter.

No spam ever. Unsubscribe anytime.
Read the Privacy Policy.