Hybrid File Server with Azure Files and Azure File Sync

Extending a file server to Azure with Azure File Sync: sync groups, cloud tiering and the free space policy, AD DS authentication, setup and fast server replacement.
Technical summary
Technology
Azure Files, Azure File Sync, SMB, Cloud tiering, AD DS, Azure RBAC, Az.StorageSync PowerShell
Topic
Extending file storage to Azure while keeping SMB shares
Level
Intermediate–advanced
Prerequisites
  • An Azure subscription and permission to create resource groups
  • Knowledge of Windows Server file servers and NTFS permissions
  • HTTPS (443) outbound from the server to Azure
In this article8 sections

The classic fix for a file server whose disk is full is buying a new disk; if most of the data hasn’t been opened in years, that money goes to files sitting on a shelf. Some data also can’t give up SMB shares: applications that expect a UNC path, large CAD and media files, ERP attachments or workflows that rely on the NTFS permission structure. Instead of forcing this data into SharePoint, you can keep the file server and extend storage to Azure. Below we explain the Azure Files and Azure File Sync architecture, cloud tiering settings, authentication options, setup steps and branch and disaster scenarios, along with the traps in the field.

When a hybrid file service is the right choice

Azure File Sync is a strong option in these cases:

  • The file server’s disk is filling up, but most of the data is rarely opened.
  • Several branches need local-speed access to the same data and you want to get rid of the operational overhead of DFS Replication.
  • When server hardware fails, the data needs to be accessible on a new server within minutes.
  • Applications expect UNC paths and NTFS permissions; moving to SharePoint would require application changes.

If team documents, co-authoring and external sharing dominate, the destination is SharePoint and OneDrive. To make this split by data type, you can use the decision table in our guide to the migration plan from file server to SharePoint and OneDrive. The two approaches run side by side in the same organization.

Azure Files and Azure File Sync components

Azure Files is a managed file share in a storage account, accessed with the SMB and NFS protocols. Azure File Sync is the service that syncs this share with Windows Servers in your on-premises server infrastructure and can optionally turn the server into a cache.

Component What it does
Storage Sync Service The parent resource in Azure; holds server registrations and sync groups
Registered server A Windows Server with the agent installed and registered with the service
Sync group The set of endpoints synced together
Cloud endpoint The Azure file share in the sync group (exactly one)
Server endpoint A folder or volume path on a registered server

Rules to know before setup:

  • A sync group has exactly one cloud endpoint and one or more server endpoints; each server endpoint must be on a different server.
  • A server can be registered with only one Storage Sync Service.
  • Different folders on the same server can be in different sync groups, but server endpoints can’t be nested.
  • Sync between the server and Azure runs over HTTPS (443); port 445 isn’t needed.
  • NTFS ACLs are preserved in the Azure file share.

Changes made directly in the Azure file share are not reflected on servers immediately but through the cloud-side change detection job (at most every 24 hours). A common complaint is “I put the file in Azure and it doesn’t show on the server,” and this is why. Users should work through the server; scripts and applications should not write directly to the Azure share.

How cloud tiering works and how to set it up

When cloud tiering is enabled, the server stops being a store holding all the data and becomes a cache of frequently used data. The content of a tiered file stays only in Azure; on the server there is a reparse point carrying the file name, size, timestamps and ACLs. When a user opens the file, the content is recalled from Azure. Users usually notice the difference only as a delay on first open.

Two policies work together:

  • Volume free space policy: The target percentage of free space on the volume. For example, if set to 20%, the least accessed files start being tiered when the volume is 80% full. This policy always takes precedence over the date policy.
  • Date policy: Files not accessed for longer than the specified number of days are tiered even if there is free space.

Things to watch when choosing settings:

  • Cloud tiering isn’t supported on the system volume; put data on a separate NTFS volume.
  • A low free space percentage keeps more data on the server but increases the risk of the volume filling up during sudden large copies.
  • Antivirus and indexing software trying to read tiered files (with the offline attribute) causes mass recalls. Verify that the software skips these files; a WAN link saturated on full-scan night is the typical symptom.
  • Software that takes file-level backups on the server side can recall tiered files. Backing up through the Azure file share with Azure Backup removes this problem.

If a specific folder needs to be available on local disk, use the server cmdlet that comes with the agent:

Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
Invoke-StorageSyncFileRecall -Path "D:\Shares\Project-2025"

Authentication: Azure Files with AD DS

As long as users access through the on-premises server, authentication is done by the Active Directory the server belongs to; no extra configuration is needed. If direct access to the Azure file share is wanted (from a virtual server in Azure or during a disaster), identity-based access is configured:

  • AD DS: The storage account is registered in on-premises AD as a computer account or service logon account with Join-AzStorageAccount from the AzFilesHybrid PowerShell module. User accounts must be synced to Entra ID.
  • Microsoft Entra Kerberos: For hybrid identities, the option that lets clients access without line of sight to a domain controller.

Authorization has two layers. At share level, Azure RBAC roles are assigned: Storage File Data SMB Share Reader, Storage File Data SMB Share Contributor and Storage File Data SMB Share Elevated Contributor. At directory and file level, the existing NTFS ACLs apply. Most organizations grant a broad role at share level and do the real restriction with NTFS; this matches the familiar file server model.

The point forgotten in AD DS registration is the password lifetime of the computer account created in AD for the storage account. If the domain password policy requires this account’s password to be rotated and it isn’t, Kerberos authentication quietly stops one day. Document which OU the account sits in and how its password is managed at registration time.

Setup steps and the initial sync

  1. Create the storage account and file share. When choosing the region, consider network proximity to the server and the need for a secondary region.
  2. Create the Storage Sync Service resource in the same region.
  3. Install the Azure File Sync agent on each file server; check the supported Windows Server versions in the agent release notes.
  4. Register the server and create the sync group and endpoints.

A sample flow with the Az.StorageSync module:

$rg  = "rg-files"
$sss = "sss-hq"
New-AzStorageSyncService -ResourceGroupName $rg -Name $sss -Location "westeurope"

# Run on the file server
$srv = Register-AzStorageSyncServer -ResourceGroupName $rg -StorageSyncServiceName $sss

New-AzStorageSyncGroup -ResourceGroupName $rg -StorageSyncServiceName $sss -Name "sg-common"

$sa = Get-AzStorageAccount -ResourceGroupName $rg -Name "stfileshq"
New-AzStorageSyncCloudEndpoint -ResourceGroupName $rg -StorageSyncServiceName $sss `
  -SyncGroupName "sg-common" -Name "ce-common" `
  -StorageAccountResourceId $sa.Id -AzureFileShareName "common"

New-AzStorageSyncServerEndpoint -ResourceGroupName $rg -StorageSyncServiceName $sss `
  -SyncGroupName "sg-common" -Name "se-fs01-common" `
  -ServerResourceId $srv.ResourceId -ServerLocalPath "D:\Shares\Common" `
  -CloudTiering -VolumeFreeSpacePercent 20 -TierFilesOlderThanDays 90

The 20% free space and 90-day date policy in this example are only sample values; set them based on your own access profile. In the initial sync, existing data is uploaded from the server to Azure. For large data sets the initial upload can take days; users keep working on the server during this time. Limit the bandwidth used during working hours with the agent’s network limit setting, or the internet line complaints will start on the first morning.

To verify, watch the sync group’s health and the number of per-item errors in the Azure portal; on the server, check the Applications and Services Logs\Microsoft\FileSync\Agent logs in Event Viewer. Long paths, invalid characters and open locked files are the most common sync errors. Don’t rely on tiering until the error count is zero.

Branch and disaster scenarios

Branch cache

Servers at head office and branches are added to the same sync group as server endpoints. Each branch keeps the data it uses on local disk, and the rest is tiered. This removes the full-copy requirement of DFS Replication. However, there is no locking for concurrent editing: if the same file is changed at the same time in two branches, a conflict occurs and one of the files is kept as a copy with the server name appended. Assess this behavior in advance for teams that work heavily on the same files at the same time. For a comparison with your current DFS setup, see our article on DFS Namespace and DFS Replication design.

Server replacement and fast recovery

When a server fails, the data is in Azure, so recovery is done with these steps:

  1. A new Windows Server is installed, the data volume prepared and the agent installed.
  2. The server is registered with the same Storage Sync Service.
  3. When creating the server endpoint, the initial download policy NamespaceOnly is chosen (-InitialDownloadPolicy NamespaceOnly). Only the folder and file namespace downloads first; files are recalled as users open them.
  4. Shares and share permissions are recreated; if DFS Namespaces are used, the target is pointed to the new server.

Users start working without waiting for all the data to be restored. Still, Azure File Sync is not a backup solution: a file deleted or encrypted by ransomware is synced to Azure too. Sync copies the mistake as well. Define snapshots and an Azure Backup policy for the Azure file share, and build your overall backup strategy within the 3-2-1-1-0 backup rule.

Comparison with a SharePoint migration

Criterion Azure File Sync SharePoint/OneDrive
Access protocol SMB (UNC path) HTTPS, sync client
Permission model NTFS ACLs preserved Site and library model
Co-authoring None, file locking Real-time co-authoring in Office
On-premises server Required (cache) Not required
Suitable data Application data, CAD, large files Team documents

For the design and operation of a hybrid file service, see our server and cloud management service. Microsoft’s Azure File Sync planning document should be the reference for planning details and limits.

Frequently asked questions

Does port 445 need to be opened to the internet for Azure File Sync?

No. The Azure File Sync agent talks to Azure over HTTPS (443). Users keep connecting to the on-premises Windows server over SMB. Port 445 is only needed if clients are to mount the Azure file share directly.

How should backups be done when cloud tiering is on?

Because the content of tiered files isn’t on the server, file-level backup on the server side can recall the files. The recommended approach is to back up the Azure file share in the cloud with Azure Backup. If backups will be taken on the server side, verify that the software recognizes tiering.

Can a server be registered with more than one Storage Sync Service?

No. A server can be registered with only one Storage Sync Service at a time. The same server can take part in different sync groups within that service with different folders.

Does Azure File Sync replace a SharePoint migration?

Their purposes differ. Azure File Sync extends storage to the cloud while keeping SMB and the NTFS permission model. SharePoint is a document management platform offering co-authoring, versioning and Teams integration. File Sync suits application-bound or large-file data; SharePoint suits team documents.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek System Support

Server installation, configuration, incident response and scheduled maintenance. Active Directory, virtualization and backup are managed with the same discipline.

Knowledge Center

Other articles