Extend Windows file servers with Azure File Sync
Extend Windows file servers with Azure File Sync
https://learn.microsoft.com/en-us/azure/storage/file-sync/file-sync-extend-
servers?toc=%2Fazure%2Fstorage%2Ffiles%2Ftoc.json
Use Azure File Sync to centralize your organization's file shares in Azure Files, while keeping the
flexibility, performance, and compatibility of an on-premises file server. Azure File Sync transforms
Windows Server into a quick cache of your Azure file share. You can use any protocol that's available
on Windows Server to access your data locally, including SMB, NFS, and FTPS. You can have as many
caches as you need across the world.
The article demonstrates the basic steps for extending the storage capacity of a Windows server by
using Azure File Sync. Although this tutorial features Windows Server as an Azure virtual machine
(VM), you would typically do this process for your on-premises servers.
• Deploy the Storage Sync Service
• Prepare Windows Server to use with Azure File Sync
• Install the Azure File Sync agent
• Register Windows Server with the Storage Sync Service
• Create a sync group and a cloud endpoint
• Create a server endpoint
To create a general-purpose v2 storage account in the Azure portal, follow these steps:
1. Under Azure services, select Storage accounts.
2. On the Storage Accounts page, choose + Create.
3. On the Basics blade, select the subscription in which to create the storage account.
4. Under the Resource group field, select your desired resource group, or create a new resource
group. For more information on Azure resource groups, see Azure Resource Manager
overview.
5. Next, enter a name for your storage account. The name you choose must be unique across
Azure. The name also must be between 3 and 24 characters in length, and may include only
numbers and lowercase letters.
6. Select a region for your storage account, or use the default region.
7. Select a performance tier. The default tier is Standard.
8. Specify how the storage account will be replicated. The default redundancy option is Geo-
redundant storage (GRS). For more information about available replication options, see Azure
Storage redundancy.
9. Additional options are available on the Advanced, Networking, Data protection,
and Tags blades. To use Azure Data Lake Storage, choose the Advanced blade, and then
set Hierarchical namespace to Enabled. For more information, see Azure Data Lake Storage
Gen2 Introduction.
10. Select Review + Create to review your storage account settings and create the account.
11. Select Create.
3. Open the downloaded RDP file and select Connect when prompted. You might see a
warning that says The publisher of this remote connection can't be identified.
Click Connect anyway.
4. In the Windows Security window that asks you to enter your credentials, select More
choices and then Use a different account. Enter localhost\username in the email
address field, enter the password you created for the VM, and then select OK.
5. You might receive a certificate warning during the sign-in process saying that the
identity of the remote computer cannot be verified. Select Yes or Continue to create
the connection.
Prepare the Windows Server VM
For the Windows Server 2019 Datacenter VM, disable Internet Explorer Enhanced Security
Configuration. This step is required only for initial server registration. You can re-enable it after the
server has been registered.
In the Windows Server 2019 Datacenter VM, Server Manager opens automatically. If Server Manager
doesn't open by default, search for it in Start Menu.
1. In Server Manager, select Local Server.
2. On the Properties pane, find the entry for IE Enhanced Security Configuration and click On.
3. In the Internet Explorer Enhanced Security Configuration dialog box,
select Off for Administrators and Users, and then select OK.
Now you can add the data disk to the VM.
Add the data disk
1. While still in the Windows Server 2019 Datacenter VM, select Files and storage
services > Volumes > Disks.
2. Right-click the 4 GiB disk named Msft Virtual Disk and select New volume.
3. Complete the wizard. Use the default settings and make note of the assigned
drive letter.
4. Select Create.
5. Select Close.
At this point, you've brought the disk online and created a volume. Open File
Explorer in the Windows Server VM to confirm the presence of the recently
added data disk.
6. In File Explorer in the VM, expand This PC and open the new drive. It's the F: drive
in this example.
7. Right-click and select New > Folder. Name the folder FilesToSync.
8. Open the FilesToSync folder.
9. Right-click and select New > Text Document. Name the text file MyTestFile.
10. Close File Explorer and Server Manager.
Next, in the Windows Server VM, install the Azure PowerShell module on the server. The Az module
is a rollup module for the Azure PowerShell cmdlets. Installing it downloads all the available Azure
Resource Manager modules and makes their cmdlets available for use.
1. In the VM, open an elevated PowerShell window (run as administrator).
2. Run the following command: Install-Module -Name Az
At this point, you've set up your environment for the tutorial. Close the PowerShell window. You're
ready to deploy the Storage Sync Service.
Deploy the Storage Sync Service
To deploy Azure File Sync, you first place a Storage Sync Service resource into a resource group for
your selected subscription. The Storage Sync Service inherits access permissions from its
subscription and resource group.
1. In the Azure portal, select Create a resource and then search for Azure File Sync.
2. In the search results, select Azure File Sync.
3. Select Create to open the Deploy Azure File Sync tab.
Value Description
Name A unique name (per subscription) for the Storage Sync Service.
Resource group The resource group that contains the Storage Sync Service.
Location East US
5. When you're finished, select Review + Create and then Create to deploy the Storage Sync
Service. The service will take a few minutes to deploy.
6. When the deployment is complete, select Go to resource.
Install the Azure File Sync agent
The Azure File Sync agent is a downloadable package that enables Windows Server to be synced with
an Azure file share.
1. In the Windows Server 2019 Datacenter VM, open Internet Explorer.
2. Go to the Microsoft Download Center. Scroll down to the Azure File Sync Agent section and
select Download.
3. Select the check box for StorageSyncAgent_WS2019.msi and select Next.
You've deployed the Azure Sync Service and installed the agent on the Windows Server VM. Now
you need to register the VM with the Storage Sync Service.
Register Windows Server
Registering your Windows server with a Storage Sync Service establishes a trust relationship
between your server (or cluster) and the Storage Sync Service. A server can only be registered to one
Storage Sync Service. It can sync with other servers and Azure file shares that are associated with
that Storage Sync Service.
The Server Registration UI should open automatically after you install the Azure File Sync agent. If it
doesn't, you can open it manually from its file location: C:\Program
Files\Azure\StorageSyncAgent\ServerRegistration.exe.
1. When the Server Registration UI opens in the VM, select Sign in.
Value Description
Azure Subscription The subscription that contains the Storage Sync Service for this tutorial.
Resource Group The resource group that contains the Storage Sync Service. Use myexamplegroup for
this tutorial.
Storage Sync Service The name of the Storage Sync Service. Use afssyncservice02 for this tutorial.
4. Select Register to complete the server registration.
5. As part of the registration process, you're prompted for an additional sign-in. Sign in and
select Next.
6. Select OK.
Value Description
Sync group name This name must be unique within the Storage Sync Service, but can be any name that is
logical for you.
Subscription The subscription where you deployed the Storage Sync Service for this tutorial.
Storage account Choose Select storage account. On the pane that appears, select the storage account
that has the Azure file share you created.
Azure file share The name of the Azure file share you created.
3. Select Create.
If you select your sync group, you can see that you now have one cloud endpoint.
Add a server endpoint
A server endpoint represents a specific location on a registered server. For example, a folder on a
server volume. To add a server endpoint:
1. Select the newly created sync group and then select Add server endpoint.
2. On the Add server endpoint pane, enter the following information to create a server
endpoint:
Value Description
Registered server The name of the server you created. For example, myVM.
Value Description
Path The Windows Server path to the drive you created. For example, f:\filestosync.
3. Select Create.
Your files are now in sync across your Azure file share and Windows Server.