Following the action plan of the previous post, now it’s time to configure the first server endpoint to be in sync with the Sync Group we created.

An important point to understand at this point is that the total cost of Azure File Sync (AFS) services is determined by the number of servers that connect to the cloud endpoint (Azure File Share) plus the underlying costs of File storage (including storage and access costs) and outbound data transfer: One sync server is free per storage sync service but any additional server will cost around  $2.50.

First Server Preparation

The server we will use has the following hardware specs:

  • SKU: F2s_v2 (2vCPU, 4GB Ram)
  • OS: Windows Server 2016
  • Additional Data disk (F:) – 10Gb

On this server I created a shared folder (FileShare1) on the additional Disk F: including 800 files of 10Mb each divided in 2 sub-directories: this represent our initial file share to be synced in the cloud.

The two sub-directories have also different permissions to test (in the next post of the serie) the ACL replication between endpoints.

The total amount of disk space used is almost 80%.


Configure File Server to Sync

When configuring a local server to sync its data to Azure, you need to download and install the Azure File sync agent from Microsoft downloads. And before installing the agent, you need to install the Azure PowerShell.

To install AzureRM PowerShell on the Windows Server 2016 box just run the following command with administrative privileges:

Install-Module AzureRM –AllowClobber

Import-Module AzureRM


Next step is to install the Azure File Sync Agent. Go to this link and download the agent installation.

The installation is really easy to use (it will ask for EULA, if you want the agent to be updated with Windows Update etc.). When the installation is completed the configuration wizard will appear.

After that you entered your credential for Azure, a set of combo box will help you on the selection if the Azure Subscription, the Resource Group and the Sync Group previously created.

Now we are ready to register the server to the sync group.

With the server registered, it’s time to configure it using the Azure Portal:

  • the Server Name will appear in the combo box (as you already have registered it with the previous wizard)
  • the Path represent the file share you want to sync
  • the Cloud Tiering is the optional feature you can enable to free-up space on your storage. I enabled it asking to have 80% of the volume free (in our test we have it at 20% free)

After few minutes, the server endpoint appear in the Azure console

The sync to the Azure Storage can take a number of hours as a snapshot is performed before any tiering actually occurs. We can force it using PowerShell:

Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
Invoke-StorageSyncCloudTiering -Path "F:\FileShare1"

After the command is completed, the report of the action taken will appear:

As you can see, in our case all 800 files are tiered because none of them was used before so the system was not able to determinate which one should stay on the disk (this will not happen on a prod environment).

If we have a look at the disk space used on the server we will notice that only 200Mb are used.

But, from user prospective, everything seems exactly the same.

On the Azure Portal we can see all the files synced in the Azure Storage using Storage Explorer:

We are now ready to add a second File Server to the Sync Group.


Comments are closed.