How To Deploy Azure File Sync
In this post, Aidan will show you how to deploy Azure File Sync to synchronize files from a file server to Azure, which you can then use to enable tiering of hot/cold files, inter-site replication, cloud-based backup. and disaster recovery.
The Scenario
In this demo lab, I have a file server which will synchronize 3 folders called Accounting, Sales, and Marketing. The destination will be a storage account in the West Europe region of Azure (Netherlands).
![The components of Azure File Sync [Image Credit: Aidan Finn]](https://petri.com/wp-content/uploads/sites/3/2018/03/Azure-File-Sync-Architecture.png 1050w, https://petri.com/wp-content/uploads/sites/3/2018/03/Azure-File-Sync-Architecture-258x300.png 258w, https://petri.com/wp-content/uploads/sites/3/2018/03/Azure-File-Sync-Architecture-768x895.png 768w, https://petri.com/wp-content/uploads/sites/3/2018/03/Azure-File-Sync-Architecture-879x1024.png 879w, https://petri.com/wp-content/uploads/sites/3/2018/03/Azure-File-Sync-Architecture-500x582.png 500w)
Prepare the File Server
The file sync agent will require the AzureRM (ARM) PowerShell modules to be installed first. You can retrieve the latest version of the released MSI installer from GitHub. Note that a new installation of the modules will require a reboot of the file server – this will probably require a maintenance window.
Storage Account
Create a general purpose (v1 or v2) storage account in the region that you want to synchronize to. Note that this storage account should be in a close Azure region (latency) to the file server – this will minimize the impact of tiering (if enabled later) or disaster recovery.
In the storage account, you should create an Azure Files share for each sync group that you require:
- If you will have multiple servers, then you might have different synchronization requirements, each needing a sync group.
- A sync group will replicate to a cloud endpoint – this is an Azure Files share. A single share can handle up to 5 TiB of data, so you might need to spread large amounts of files across different Azure Files shares/sync groups. Remember to allow for future growth!
Note that leaving quota blank will use the maximum limit of 5 TiB.
![The Azure Files Shares that each file server share will synchronize to [Image Credit: Aidan Finn]](https://petri.com/wp-content/uploads/sites/3/2018/08/TheAzureFilesShares.png 482w, https://petri.com/wp-content/uploads/sites/3/2018/08/TheAzureFilesShares-300x197.png 300w)
Deploy Storage Sync
The next step is to deploy the Storage Sync service in Azure. Open the Azure Portal and deploy Azure File Sync – this will launch the Deploy Storage Sync blade. Give the storage sync service a name, and choose a resource group and Azure region to deploy it into.
![Deploying the Azure Files Sync storage sync resource [Image Credit: Aidan Finn]](https://petri.com/wp-content/uploads/sites/3/2018/08/DeployingAzureFileSyncStorageSync-300x290.png 300w, https://petri.com/wp-content/uploads/sites/3/2018/08/DeployingAzureFileSyncStorageSync.png 312w)
Install File Sync Agent
The storage sync service will only take a few seconds to deploy in Azure. Once ready, open the storage sync service and browse to Registered Servers. Click the link to download the Azure File Sync agent, and download/copy the installer to your file server.
Note that there is a version for Windows Server 2012 R2 and Windows Server 2016 – older versions of Windows Server are not supported.
Run the installer on the file server – it’s a pretty typical & simple Microsoft installer. Note that you can configure the agent to communicate with Azure through a proxy server.
Register File Sync Agent
The registration wizard will automatically launch but you can also start it manually – C:\Program Files\Azure\StorageSyncAgent\ServerRegistration.exe.
Unlike with Azure Site Recovery or Azure Backup, you will register the agent using a username/password rather instead of using a downloaded credentials file. How this will work depends on if your subscription has been acquired through the Cloud Solutions Provider (CSP) channel or not.
You will be prompted to sign into your Azure subscription. There is a toggle that you must select if you are using a CSP channel subscription.
- The subscription that the storage sync service is in
- The resource group that the storage sync service is in
- The storage sync service
![The registered file server appears in Azure [Image Credit: Aidan Finn]](https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncRegisteredServers.png 1428w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncRegisteredServers-300x75.png 300w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncRegisteredServers-768x191.png 768w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncRegisteredServers-1280x318.png 1280w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncRegisteredServers-500x124.png 500w)
Create Sync Groups
I will create one sync group for each shared folder on my file server, and each will synchronize to a cloud endpoint (Azure Files share).
Browse to Sync Groups in the storage sync service and click + Sync Group. In the Sync Group balde:
- Name the new sync group. What you call each sync group has no impact on the shares, but I like to keep my names consistent.
- Select the storage account and already-existing Azure Files share that will become the cloud endpoint (replication target in Azure).
- Registered Server: Select the file server that you previously registered
- Path: Add the folder path of the folder/share that you wish to synchronize to Azure
- Cloud Tiering: Choose if you want to enable tiering of cold files to Azure and, if you do, how much space should be freed up on the file server – I’ll cover this more in a later article.
The Health state of the server endpoint will switch between Provisioning, Pending, and Healthy while the configuration in deployed and content is synchronized for the first time.
Eventually you should find that the share in the storage account will be populated with all the files from the file server. The synchronized cloud copy of the folder should now be considered the master copy, and the file server should be considered as a local proxy of the share(s).
![The sync groups for my lab [Image Credit: Aidan Finn]](https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncSyncGroups-300x68.png 300w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncSyncGroups-768x174.png 768w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncSyncGroups-500x113.png 500w, https://petri.com/wp-content/uploads/sites/3/2018/08/AzureFileSyncSyncGroups.png 1183w)