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.
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).
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.
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.
I have created three shares, one for each folder that has a large amount of data each.
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.
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 next screen will ask you to select:
- The subscription that the storage sync service is in
- The resource group that the storage sync service is in
- The storage sync service
Then you will click register … and be requested to sign in a second time. And then your file server will appear in the storage sync service in Azure, and you can start to synchronize folders to your storage account.
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).
Wait for the sync group to be created and then open it. Note that we haven’t added a folder/share from the file server (server endpoint) to the sync group yet – we have only added the cloud replication target (cloud endpoint). Now click Add Server Endpoint. Enter the following information:
- 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.
Note that you can synchronize this folder/share between multiple file servers by adding many server endpoints – I’ll also cover this in another 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).
You can repeat these steps for each sync group that you need to create.