Lesson 2 of 2 Azure Files Shares

Protecting File Shares with Snapshots and Soft Delete

This lesson explains share snapshots and soft delete for file shares, and which one recovers which kind of loss.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe share snapshots and how files are restored from them.
  • Describe soft delete for file shares and its scope.
  • Choose the recovery feature for a data loss scenario.

Share snapshots

A share snapshot is a read-only, point-in-time copy of an entire file share. Snapshots are incremental: only data changed since the previous snapshot is stored and billed. A share can have up to 200 snapshots, and snapshots are taken at share level, though files are restored individually. Snapshots are created on the share's Snapshots page, with az storage share snapshot, or on a schedule by Azure Backup, which manages snapshot retention for Azure Files.

To restore, browse a snapshot in the portal and Restore a file over the original or under a new name, or copy it with AzCopy. On Windows clients, mounted shares expose snapshots as Previous Versions in File Explorer, so users can restore files themselves. A share cannot be deleted while it has snapshots unless the snapshots are deleted with it, and deleting the share deletes its snapshots.

The following diagram matches each risk to a finance file share with the protection that addresses it.

Protecting a finance share at two levels without scripts. Soft delete for file shares with 30 days' retention makes a deleted share recoverable; Azure Backup with a policy taking a daily snapshot kept for 30 days provides yesterday's file versions, which users restore themselves through Previous Versions.
The scenario is illustrative.
True or false

Share snapshots

Exam skills 2.3.5

Check how share snapshots store and restore data.

Log in to try this activity Interactive activities are free with an account.

Soft delete for file shares

Soft delete for file shares is enabled on the storage account's Data protection page (or the File shares settings) with a retention period of 1 to 365 days; new accounts enable it with seven days by default. A deleted share, including its snapshots, enters a soft-deleted state and appears when Show deleted shares is selected; Undelete restores it under its original name. Soft-deleted shares are billed for their used capacity.

Soft delete works at share level only. Deleting a file inside a share is not protected by it; individual files are recovered from a snapshot or from an Azure Backup recovery point. For the same reason, Azure Backup for Azure Files relies on soft delete being enabled, so that an accidentally deleted share does not take its backup snapshots with it. The table below compares the features.

ScenarioRecovery feature
A file was deleted or overwritten yesterdayShare snapshot (or Azure Backup)
The whole share was deletedSoft delete for file shares
Scheduled snapshots with daily, weekly and monthly retentionAzure Backup for Azure Files
Users restore files themselves on WindowsPrevious Versions (share snapshots)
Sort into groups

Which recovery feature?

Exam skills 2.3.5

Choose the feature that recovers data in each situation.

Log in to try this activity Interactive activities are free with an account.
Worked example

Protecting a departmental share

A finance department stores spreadsheets on an Azure file share. Users occasionally overwrite files and must be able to restore the previous day's version themselves. The share itself must be recoverable for 30 days if someone deletes it. Snapshots must be taken daily and kept for 30 days without scripts. What should you configure?

Enable soft delete for file shares with 30 days of retention, and protect the share with Azure Backup using a policy that takes a daily snapshot and keeps it for 30 days. Users restore files through Previous Versions, which shows the snapshots. Blob soft delete and versioning do not apply to Azure Files, and manual snapshots would require a script or daily effort.

Check yourself

Can soft delete for file shares restore a single file deleted from a share?

Show answer

No. It restores whole deleted shares; individual files come from a share snapshot or Azure Backup.

Exam Tips

Remember for the exam

  • Share snapshots are incremental, read-only and limited to 200 per share.
  • Soft delete restores whole shares, not individual files.
  • Users restore files from snapshots with Previous Versions on Windows.
  • Scheduled snapshots with retention: Azure Backup for Azure Files.