Step-by-step guide: Getting started with Azure File Sync service

Microsoft Azure has an offering called Azure File Sync, which allows the synchronization of on-premises file servers with Azure Files supported by Storage Accounts. There are several benefits of using this approach — it could be used for transition between on-premises and cloud, backup, and disaster recovery. One thing in common on all these scenarios is the ability to move your file server data to the cloud and reduce costs on-premises by removing backup requirements, disaster recovery, or eliminating the file server all together.

Azure File Sync can be used as a transition tool to move file server data to the cloud, but also as a synchronization tool to keep more than one server synchronized without the use of DFS or any other replication technology. Last but not least, we can leverage the cloud and use tiering, where unused files on the local file servers can be moved to Azure Files and a local reference of the file stays locally. For the end-user it is a transparent process and no additional tools are required.

The process to use Azure File Sync comprises three steps: configure the service in Microsoft Azure, install the agents, and configure the replication.

In this article, we will cover these basic steps and make sure that all data from our file server is in a resilient and redundant cloud storage solution.

A simple scenario

To understand better how Azure File Sync works, let’s create a simple scenario where we have a File Server on-premises called TORFS01 and we have a Public shared folder. For this article it is located on C:\home\public (in a production environment it must be located in a different disk other than the operating system volume). We added some pictures and a new folder in the share, as depicted in the image below (please note that we are accessing that information through UNC path.)

azure file sync

Creating the Storage Account

Before creating the Azure File Sync, we need to prepare a Storage Account that will receive all data from the File Servers on-premises. From the design perspective, it is highly recommended to use a GRS (Geo-Redundant Storage which uses the three local replicas + three additional replicas in another region) to make sure that all data that is being synchronized to the cloud does not have a single point of failure.

In this article, we will be creating a Storage Account called techgenix and we will use Storage V2 (general purpose v2) account, and Standard performance (magnetic disks, low cost). After making all decisions, click on Create.

azure file sync

After creating the Storage Account to support the upcoming Azure File Sync, our next step is to replicate the share structure that we have on-premises in the Storage Account/Files. Based on our scenario, we will be replicating a shared folder called Public and we will be creating a Shared Folder called public and we will set the Quota to 4096GB.

azure file sync

Creating the Azure File Sync

Logged on the Azure Portal, click on New Resource, and type in File Sync, and select Azure File Sync from the list. In the initial blade, a short summary of the service will be described, click on Create.

azure file sync

Click on Create. In the new blade, we need to define the name for the Azure File Sync, Resource Group, and location. After making the decision, click on Create button to complete the process and wait for the provision to be completed.

Configuring the server endpoints

The first step on the server where we are going to install the Storage Sync Agent is to make sure that the AzureRM module is installed. Using the following PowerShell cmdlet we can install the module. A few confirmations to install additional software from unknown repositories will be requested, so please confirm when necessary.

If the AzureRM is already present on your server, run Update-Module AzureRM just to confirm that the latest modules are in place.

Install-Module AzureRM

azure file sync

The second step is to download and install the Storage Sync Agent, which can be retrieved from this link here, and a link with the latest bits is also available on the Registered Servers item of Azure Sync Service in the Azure Portal.

The download has to be done per operating system. Nowadays, we have a version for 2012 R2 and 2016. Select the version based on your operating system, download and execute the file.

The entire installation process does not require any special configuration — use default values to complete the installation, and it shouldn’t take more than a couple of minutes.

After the installation is complete, Azure File Sync will open automatically. In the first run it will check for an update on the agent that we have just installed (it was one of the selected options during the installation to check for updates). If there are no updates, click on OK to move forward.

In the Sign in and register this server page, click on Sign in button and provide your credentials to access Microsoft Azure (a new page will be open, go through the authentication process and when it is complete you will return automatically to the same wizard).

azure file sync

In the Choose a Storage Sync Service page, we need to select the subscription, resource group, and Storage Account and we will use the ones that we have just created in the previous step. If everything goes well, a Registration Successful! page will be displayed. Click on OK.

azure file sync

The result of that operation will be the server showing up on the Registered Servers in the File Sync service, as depicted in the image below.

azure file sync

Creating a Sync group

So far we created the requirements on both sides of the fence: on-premises and Azure to support the file synchronization. What glues them together is the Sync group where we define server endpoints and cloud endpoints, and after that is just matter of time to let them replicate and keep the synchronization.

Open the Azure File Sync resource in Microsoft Azure portal, click on Sync groups, and to start the creation of a new one click on + Sync Group button located at the top of the new blade on the right side. In the new blade, define a name for the Sync Group, and define the cloud endpoint, which is comprised of the Subscription, Storage Account, and File Share (which was created prior to this wizard).

azure file sync

After creation, we will have a Sync Group with one cloud endpoint that we have just configured, and our next task is to add server endpoints, and we can do that by hitting the Add server endpoint button. Select the registered server and the path from where we want to synchronize the data. Click on Create.

azure file sync

The result will be a Sync Group with one cloud endpoint and one server endpoint and its status, in our case shows health, which is a good sign.

azure file sync

After getting a health status, we can check the Storage Account, and under the File Share that we created to support the synchronization, we can validate that all data that we have on-premises is being synchronized.

azure file sync

Wrapping up

If you are planning to move your File Server data to Microsoft Azure, you must check Azure File Sync and use it to create a smooth transition from on-premises to the cloud without impacting users and applications.

Featured image: Shutterstock

About The Author

5 thoughts on “Step-by-step guide: Getting started with Azure File Sync service”

  1. great article…. Thank you … I have Scenario when I have large amount of on Prem Shares (from the same File server) to be synced to Azure (not the migration) for redundency/DR .. Would I need to create multiple Share resource on Azure side?

  2. great article!

    Good thing to know also is that you need specific rights to create a cloud-endpoint. i was given contributor roles and as such i can do most but not all activities:

    Cloud endpoint creation fails, with this error: “AuthorizationFailed”
    This error occurs if your user account doesn’t have sufficient rights to create a cloud endpoint.
    To create a cloud endpoint, your user account must have the following Microsoft Authorization permissions:
    Read: Get role definition
    Write: Create or update custom role definition
    Read: Get role assignment
    Write: Create role assignment

    the errormessage is very clear, but was for me unexpected.
    i have done the whole exercise several times just to find out that whatever i did i would not have the correct rights. (it wasn’t related to resources created by someone else for instance)
    thanks for the great article.

  3. Nice One.

    We have two sites (Site R & Site U) each has File server and both the site doesn’t have any connectivity other than internet.

    Requirement is below :

    1. File shares on the Site R & Site U should be synced and accessible for users (Site R users should to hit Site R File Server & Site U users to hit Site U File Server)

    2. Users frequently moves between the site.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top