Azure file share soft delete
Summary β Azure file share soft-delete
What it is
Soft delete for Azure Files preserves deleted file shares for a configurable retention period so they can be undeleted (restored) along with their contents and snapshots.
Soft delete is enabled at the storage account (FileService) level and applies to all file shares in that account.
Default retention is 7 days; you can set any value from 1 to 365 days. The retention clock starts when a share is deleted.
To permanently delete a soft-deleted share before expiry you must: undelete it, disable soft delete, then delete the share again.
For provisioned (quota-based) file shares, the provisioned quota is counted against the storage account until the soft-deleted share fully expires.
Soft delete protects shares only (not individual files). To restore deleted files, use share snapshots or Azure file share backup.
Applies to
Various management/billing/redundancy combinations are supported (see original table). SMB support varies by SKU and redundancy. (Original table retained in source.)
Billing
Billing behavior depends on billing model. See the original links:
Provisioned v2 soft-delete
Provisioned v1 soft-delete
Pay-as-you-go soft-delete
How to toggle soft delete (enable)
PowerShell β enable soft delete
Update FileService properties (replace and ):
$resourceGroupName = "<resource-group>"
$storageAccountName = "<storage-account>"
Update-AzStorageFileServiceProperty `
-ResourceGroupName $resourceGroupName `
-StorageAccountName $storageAccountName `
-EnableShareDeleteRetentionPolicy $true `
-ShareRetentionDays 7Azure CLI β enable soft delete
Replace variables as needed:
resourceGroupName="<resource-group>"
storageAccountName="<storage-account>"
az storage account file-service-properties update \
--resource-group $resourceGroupName \
--account-name $storageAccountName \
--enable-delete-retention true \
--delete-retention-days 7How to restore a soft-deleted file share
How to disable soft delete
Important notes and links
Soft delete is at the share level only. For file-level recovery use share snapshots or Azure File Share Backup.
Soft delete settings apply to all shares in the storage account; disabling soft delete does not prevent undelete of shares deleted prior to disabling (they can still be undeleted until their expiry).
Billing differs by billing model; see the linked billing pages in the original article.
For preventing deletion/modification of the storage account itself, see the resource lock links in the original page.
Images and full command examples are available in the original article (links retained). Last updated in source: 07/31/2025.
Was this helpful?