Azure File Share Snapshots

Azure File Share Snapshots

Azure File Share Snapshots

Definition:
A share snapshot is a point-in-time, read-only copy of a file share. Snapshots allow recovery of files or the entire share if needed.

Key Points:

  • Snapshots are incremental, storing only changes since the last snapshot.

  • You cannot delete a share with snapshots; all snapshots must be deleted first.

  • Retention: Only the most recent snapshot is needed to restore the share.

Use Cases:

  1. Protection against application errors or corruption – take a snapshot before deploying new application code.

  2. Recovery from accidental deletion or renaming – restore individual files.

  3. Backup purposes – periodic snapshots help with auditing and disaster recovery.

Management via Portal:

  1. Access file share → Create Snapshot.

  2. View Snapshots to verify creation.

  3. Restore or download individual files from snapshots.

Management via PowerShell:

  • Create file share:

$storageContext = New-AzStorageContext -StorageAccountName "YourStorageAccountName" -StorageAccountKey $storageAccountKey
$share = New-AzStorageShare "YourFileShareName" -Context $storageContext
  • Mount file share:

$password = ConvertTo-SecureString -String $storageAccountKey -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential("AZURE\$storageAccountName", $password)
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\$($fileShare.StorageUri.PrimaryUri.Host)\$($fileShare.Name)" -Credential $credential -Persist
  • Unmount: Remove-PSDrive -Name Z


2. Azure File Sync

Definition:
Azure File Sync centralizes file shares in Azure Files, while maintaining local server performance. It enables caching, tiering, and synchronization of files across multiple locations.

Benefits & Use Cases:

  1. Lift and Shift: Move applications between Azure and on-premises seamlessly.

  2. Branch Office Support: Provide local access and backups.

  3. Backup & Disaster Recovery: Azure Backup integrates with File Sync.

  4. File Archiving (Cloud Tiering): Frequently accessed files stay local; others are tiered to Azure.

Cloud Tiering:

  • Locally cached files remain accessible.

  • Tiered files have a reparse point linking to Azure Files.

  • Offline files are indicated by greyed icons.


3. Azure File Sync Components

Component Description
Storage Sync Service Top-level Azure resource managing sync relationships.
Sync Group Defines the synchronization topology.
Registered Server Represents a trust relationship with Storage Sync Service.
Azure File Sync Agent Enables Windows Server to sync with Azure:
FileSyncSvc.exe (service)
StorageSync.sys (file system filter)
– PowerShell cmdlets
Server Endpoint Folder on a registered server synced to Azure.
Cloud Endpoint Azure file share that is part of a sync group.

4. File Sync Configuration Steps

  1. Deploy Storage Sync Service via Azure portal.

  2. Prepare Windows Server (disable IE Enhanced Security, update PowerShell).

  3. Install Azure File Sync Agent (keep default path, enable Microsoft Update).

  4. Register Windows Server with Storage Sync Service (requires Subscription, Resource Group, Storage Sync Service).

  5. Setup Sync Groups & Endpoints to start file synchronization.


Key Takeaways:

  • Share snapshots are incremental backups at the share level.

  • Azure File Sync allows hybrid cloud + on-premises file access, optimized with cloud tiering.

  • Proper setup requires understanding of Storage Sync Service, sync groups, server endpoints, and cloud endpoints.