2021 Annual Petri Reader Survey - We want to know what's important to you! 2021 Annual Petri Reader Survey - We want to know what's important to you!
Microsoft Azure

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]
The components of Azure File Sync [Image Credit: Aidan Finn]

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.

Creating an Azure Files share [Image Credit: Aidan Finn]
Creating an Azure Files share [Image Credit: Aidan Finn]
I have created three shares, one for each folder that has a large amount of data each.

The Azure Files Shares that each file server share will synchronize to [Image Credit: Aidan Finn]
The Azure Files Shares that each file server share will synchronize to [Image Credit: Aidan Finn]

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]
Deploying the Azure Files Sync storage sync resource [Image Credit: Aidan Finn]

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.

Sign in to register Azure File Sync agent [Image Credit: Aidan Finn]
Sign in to register Azure File Sync agent [Image Credit: Aidan Finn]
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

Select the Azure File Sync storage sync service [Image Credit: Aidan Finn]
Select the Azure File Sync storage sync service [Image Credit: Aidan Finn]
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.

The registered file server appears in Azure [Image Credit: Aidan Finn]
The registered file server appears in Azure [Image Credit: Aidan Finn]

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).

Creating a new sync group in Azure File Sync [Image Credit: Aidan Finn]
Creating a new sync group in Azure File Sync [Image Credit: Aidan Finn]
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.

Adding a server endpoint to a sync group in Azure File Sync [Image Credit: Aidan Finn]
Adding a server endpoint to a sync group in Azure File Sync [Image Credit: Aidan Finn]
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).

The synchronized files from the file server [Image Credit: Aidan Finn]
The synchronized files from the file server [Image Credit: Aidan Finn]
You can repeat these steps for each sync group that you need to create.

The sync groups for my lab [Image Credit: Aidan Finn]
The sync groups for my lab [Image Credit: Aidan Finn]

Related Topics:

BECOME A PETRI MEMBER:

Don't have a login but want to join the conversation? Sign up for a Petri Account

Register
Comments (1)

One response to “How To Deploy Azure File Sync”

  1. Thomasso

    Hi.


    I'm faily new to Azure and I proactively excuse if this is somehow a lame question.


    I'm trying to setup Azure file sync for a test/home lap environment with an Azure Pay-As-You-Go subscription.

    My Azure account is setup using my personal Microsoft account, and I'm actually not sure whether this is the core issue here.


    My goal is to create a solution where file server in my test lap - a Windows Server 2019 std (currently running in evaluation mode), syncs some shared folders to Azure.

    I try to setup this using the tutorial on this page, but cannot complete the server registration step.


    I have setup a Storage Account in Azure under my subscription and a created a Storage Sync Service.

    I downloaded the Azure File sync agent and install,ed it on my 2019 server (after installing the az powershell modules using Install-Module -Name Az -Repository PSGallery -Force).


    Everything should be in place according to the tutorial from petri.com, but when I run the Azure file sync server registration wizard, I'm not able to login.

    My username and/or password is rejected.


    First I thought it would be related to Internet Explorer and I disabled the enhanced security, but the problem persisted. So I downloaded and used Google Chrome instead, which for the most cases solves such issues. But still the same.

    I reset my Live account password, but still no luck.


    I tried to logoff the portal and login again with the same credentials, and got in.

    I tried again from the server but kept get rejected.

    I tried with my company Microsoft account and got through and got an error about no subscription found. So the login works from the server in terms of prerecuisite software etc.


    I'm bangin my head against the wall. Is this related to the type of account I use for this? It's strange because I can setup everything from within the Azure portal, so I guess this is not the case. But still....

Leave a Reply

Aidan Finn, Microsoft Most Valuable Professional (MVP), has been working in IT since 1996. He has worked as a consultant and administrator for the likes of Innofactor Norway, Amdahl DMR, Fujitsu, Barclays and Hypo Real Estate Bank International where he dealt with large and complex IT infrastructures and MicroWarehouse Ltd. where he worked with Microsoft partners in the small/medium business space.

Register for the Hybrid Identity Protection (HIP) Europe Conference!

Hybrid Identity Protection (HIP) Europe 2021 - Virtual Conference

Mobile workforces, cloud applications, and digitalization are changing every aspect of the modern enterprise. And with radical transformation come new business risks. Hybrid Identity Protection (HIP) is the premier educational forum for identity-centric practitioners. At the inaugural HIP Europe, join your local IAM experts and Microsoft MVPs to learn all the latest from the Hybrid Identity world.