Back up a file share and restore a deleted file

Azure Portal, Hands On25 minutes, plus waitingCosts moneySteps checked 25 October 2026By Cloud Hands On

In this task you'll back up an Azure file share and restore a file.

Backing up an Azure file share uses share snapshots: point-in-time copies kept in the same storage account, managed by the vault on a schedule. You can restore the whole share, or just the files someone deleted, to the original place or somewhere else.

Once a share is protected, the vault owns its snapshots, and the storage account is registered to the vault. Clean-up goes in that order too: stop the backup, then unregister the account, then delete the vault.

Example. Larkfield Group's office shares are backed up every evening. When someone saved over the shared price list, the help desk restored yesterday's copy of that one file in five minutes.

Costs money. Each storage account with backed-up shares has a small monthly fee, charged by the day, plus the snapshot storage it uses. A test of a few hours with a tiny file costs a penny or two. Stop the backup and delete the data straight after.

Before you start

You need: Backup Contributor on the vault and Storage Account Contributor on the storage account. Time: 25 minutes, plus waiting.

Where to look

  1. Storage accounts
  2. your account
  3. File shares
  4. share1
  5. Backup

Steps

  1. Do Create a file share (Azure Files) first, and upload a small text file to share1. Keep rsv-practice from the last task.
  2. Open the share and select Backup (under Operations). Choose rsv-practice as the vault.You can also start from the vault: + Backup, with workload Azure and Azure FileShare.
  3. For the backup policy, choose Create new or accept the suggested daily policy, then select Enable backup.The portal registers the storage account with the vault, turns on soft delete for the share and adds a delete lock to the storage account. If the first try fails with an internal error, wait a few minutes and try again: the second attempt usually works.
  4. When it's done, open the vault, then Backup items, Azure Storage (Azure Files) and your share. Select Backup now and keep it for a few days.Watch progress under Backup jobs. A tiny share finishes in a minute or two.
  5. Delete the text file from the share in the storage account.
  6. Back on the backup item, select File Recovery. Choose the recovery point, restore to the Original Location, pick the file and select Restore.Restore Share would bring back the whole share instead.
  7. Check the share. The file is back. Look at Backup jobs in the vault to see the restore job.

Commands

# A new vault has no file share policy, so make a daily one that keeps 7 days
T=$(date -u +%Y-%m-%dT22:00:00Z)
cat > policy.json <<EOF
{"properties":{"backupManagementType":"AzureStorage","workLoadType":"AzureFileShare","schedulePolicy":{"schedulePolicyType":"SimpleSchedulePolicy","scheduleRunFrequency":"Daily","scheduleRunTimes":["$T"]},"retentionPolicy":{"retentionPolicyType":"LongTermRetentionPolicy","dailySchedule":{"retentionTimes":["$T"],"retentionDuration":{"count":7,"durationType":"Days"}}},"timeZone":"UTC"}}
EOF
az backup policy create --resource-group rg-portal-practice --vault-name rsv-practice --name policy-files \
  --backup-management-type AzureStorage --policy policy.json

# Protect the share (retry once if it reports an internal error)
az backup protection enable-for-azurefileshare --resource-group rg-portal-practice --vault-name rsv-practice \
  --storage-account <account> --azure-file-share share1 --policy-name policy-files

# Back up now, then watch the jobs
az backup protection backup-now --resource-group rg-portal-practice --vault-name rsv-practice \
  --container-name <account> --item-name share1 --backup-management-type AzureStorage
az backup job list --resource-group rg-portal-practice --vault-name rsv-practice --output table

Watch out for

Cost
A monthly fee for each storage account with protected shares (smaller under 250 GB), charged by the day, plus snapshot storage. Stopping the backup and deleting its data ends both charges.
Security
Anyone who can delete the storage account can delete snapshot backups with it. For real data, add a delete lock to the storage account and consider vaulted backup, which keeps a copy outside the account.
Common mistakes
Trying to delete the vault while the share is still protected or the account still registered. Deleting the storage account first, which leaves an orphaned backup item.

Clean up

  1. Recovery Services vaults
  2. rsv-practice
  3. Backup items
  4. Azure Storage (Azure Files)
  5. Stop backup

In the backup item, choose Stop backup with Delete Backup Data. Then open Backup Infrastructure under Manage, Storage accounts and select Unregister for the account. Then delete rsv-practice. If the vault still refuses, its message names what's attached. Finally delete the share or the resource group.

Words to know

Snapshot
A read-only copy of the share at one moment.
Backup now
An on-demand backup outside the schedule, kept for as long as you say.
Item-level restore
Restoring chosen files or folders instead of the whole share.

Tick off each step and track your progress in the guide.

Open this task in Azure Portal, Hands On

Keep going