Configure snapshots and soft delete for Azure Files

Configure Azure Files and Azure Blob Storage

📘Microsoft Certified: Azure Administrator Associate (AZ-104)


1. Azure Files Overview

Azure Files provides fully managed file shares in the cloud that you can access via SMB (Server Message Block) or NFS (Network File System) protocols.

  • SMB is mostly used for Windows environments.
  • NFS is mostly used for Linux environments.

Azure Files is like a network drive in the cloud that multiple users or servers can access simultaneously.

When working with critical data, it’s important to have data protection features like snapshots and soft delete.


2. Snapshots for Azure Files

What is a Snapshot?

  • A snapshot is a read-only copy of a file share at a specific point in time.
  • It captures the state of files and folders at that moment.
  • Snapshots are incremental, meaning only changes since the last snapshot are stored, saving storage space.

Key Points for the Exam

  • Snapshots cannot be directly modified.
  • You can restore an entire share or individual files/folders from a snapshot.
  • Snapshots are stored in the same storage account as the original file share.
  • You can schedule snapshots using Azure Backup or PowerShell/CLI.

How Snapshots Are Used in IT

  • If a user accidentally deletes a critical configuration file, you can restore it from a snapshot.
  • If a server configuration went wrong after an update, you can roll back the entire file share to a previous snapshot.

How to Create a Snapshot

You can create snapshots via:

  1. Azure Portal
    • Go to your storage accountFile shares → select the share → Snapshots+ Snapshot.
  2. Azure PowerShell # Create a snapshot of a file share $resourceGroup = "MyResourceGroup" $storageAccount = "MyStorageAccount" $fileShare = "MyFileShare" New-AzStorageShareSnapshot -Context $(Get-AzStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccount).Context -Name $fileShare
  3. Azure CLI az storage share snapshot --account-name MyStorageAccount --name MyFileShare

3. Soft Delete for Azure Files

What is Soft Delete?

  • Soft delete protects files from accidental deletion.
  • When you delete a file or folder, it moves to a temporary recovery state instead of being permanently deleted.
  • You can recover the deleted file/folder within a retention period.

Key Points for the Exam

  • Soft delete applies to files, folders, and entire shares.
  • Retention period can be set from 1 to 365 days.
  • Soft delete does not prevent snapshots from being deleted, but snapshots themselves can also be protected with soft delete.

How Soft Delete Works in IT

  • A user accidentally deletes a critical log file. With soft delete enabled, you can restore the deleted file from the retention period, avoiding downtime or data loss.
  • If a malicious process deletes important configuration files, soft delete provides a safety net.

How to Enable Soft Delete

  1. Azure Portal
    • Go to Storage AccountData ProtectionFile share soft deleteEnable → set Retention Days.
  2. Azure PowerShell # Enable soft delete with 30-day retention $context = (Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "MyStorageAccount").Context Set-AzStorageServiceProperty -ServiceType File -EnableDeleteRetention $true -DeleteRetentionDays 30 -Context $context
  3. Azure CLI az storage account blob-service-properties delete-policy update --account-name MyStorageAccount --enable true --days-retained 30

4. Exam Tips

For the AZ-104 exam, remember the following:

  • Snapshots = read-only copies at a point in time.
  • Soft Delete = recover deleted files/folders within retention period.
  • Snapshots and soft delete can coexist.
  • Know how to enable, configure, and restore from snapshots and soft delete using Portal, PowerShell, or CLI.
  • Be familiar with retention settings and limitations:
    • Soft delete can be 1–365 days.
    • Snapshots are incremental, not full copies every time.

5. Quick Comparison Table for Exam

FeaturePurposeCan RestoreRetention / Notes
SnapshotPoint-in-time copy of file shareYesIncremental, stored in same account
Soft DeleteRecover deleted files/foldersYes1–365 days, protects against accidental deletion

By understanding what snapshots and soft delete do, how to configure them, and how they are used in IT scenarios, you will be well-prepared for any exam question on this topic.

Leave a Reply

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

Buy Me a Coffee