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:
-
Protection against application errors or corruption – take a snapshot before deploying new application code.
-
Recovery from accidental deletion or renaming – restore individual files.
-
Backup purposes – periodic snapshots help with auditing and disaster recovery.
Management via Portal:
-
Access file share → Create Snapshot.
-
View Snapshots to verify creation.
-
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:
-
Lift and Shift: Move applications between Azure and on-premises seamlessly.
-
Branch Office Support: Provide local access and backups.
-
Backup & Disaster Recovery: Azure Backup integrates with File Sync.
-
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
-
Deploy Storage Sync Service via Azure portal.
-
Prepare Windows Server (disable IE Enhanced Security, update PowerShell).
-
Install Azure File Sync Agent (keep default path, enable Microsoft Update).
-
Register Windows Server with Storage Sync Service (requires Subscription, Resource Group, Storage Sync Service).
-
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.