Deploying Azure File Sync and Replicate with on-premises file server 2019

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.

Prerequisites

  • An Azure storage account and an Azure file share in the same region that you want to deploy Azure File Sync
    • Create a storage account
    • Create a file share
  • At least one supported instance of Windows Server or Windows Server cluster to sync with Azure File Sync.
  • Ensure PowerShell 5.1 is installed on your Windows Server. If you are using Windows Server 2012 R2, ensure that you are running at least PowerShell 5.1.*.
  • The Az and the AzureRM PowerShell modules.
    • The AzureRM PowerShell module can be installed by executing the following PowerShell cmdlet:

    Install-Module AzureRM

This blog post shows how to deploy Azure File Sync and Replicate with on-premises file server.

Create a storage account

Log in to the Azure portal.

In the Azure portal, select All services. In the list of resources, type Storage Accounts. As you begin typing, the list filters based on your input. Select Storage Accounts.

On the Storage Accounts window that appears, choose Add.

Select the subscription in which to create the storage account.

Under the Resource group field, select Create new. Enter a name for your new resource group, as shown in the following image.

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 can include numbers and lowercase letters only.

Select a location for your storage account, or use the default location.

Leave these fields set to their default values:

Field Value
Deployment model Resource Manager
Performance Standard
Account kind StorageV2 (general-purpose v2)
Replication Locally redundant storage (LRS)
Access tier Hot

Select Review + Create


Review your storage account settings and create the account.

Select Create.

Create a file share in Azure Files

Go to the Storage Account blade on the Azure portal


Click on File Share

Provide Name and Quota. Click Create

Deploy the Storage Sync Service

The deployment of Azure File Sync starts with placing a Storage Sync Service resource into a resource group of your selected subscription. i recommend provisioning as few of these as needed. You will create a trust relationship between your servers and this resource and a server can only be registered to one Storage Sync Service. As a result, it is recommended to deploy as many storage sync services as you need to separate groups of servers. Keep in mind that servers from different storage sync services cannot sync with each other.

To deploy a Storage Sync Service, go to the Azure portal, click Create a resource and then search for Azure File Sync.

In the search results, select Azure File Sync, and then select Create to open the Deploy Storage Sync tab.

On the pane that opens, enter the following information:

  • Name: A unique name (per subscription) for the Storage Sync Service.
  • Subscription: The subscription in which you want to create the Storage Sync Service. Depending on your organization’s configuration strategy, you might have access to one or more subscriptions. An Azure subscription is the most basic container for billing for each cloud service (such as Azure Files).
  • Resource group: A resource group is a logical group of Azure resources, such as a storage account or a Storage Sync Service. You can create a new resource group or use an existing resource group for Azure File Sync. (We recommend using resource groups as containers to isolate resources logically for your organization, such as grouping HR resources or resources for a specific project.)
  • Location: The region in which you want to deploy Azure File Sync. Only supported regions are available in this list.

When you are finished, select Create to deploy the Storage Sync Service.

Create a sync group and a cloud endpoint

A sync group defines the sync topology for a set of files. Endpoints within a sync group are kept in sync with each other. A sync group must contain one cloud endpoint, which represents an Azure file share and one or more server endpoints. A server endpoint represents a path on registered server. A server can have server endpoints in multiple sync groups. You can create as many sync groups as you need to appropriately describe your desired sync topology.

A cloud endpoint is a pointer to an Azure file share. All server endpoints will sync with a cloud endpoint, making the cloud endpoint the hub. The storage account for the Azure file share must be located in the same region as the Storage Sync Service. The entirety of the Azure file share will be synced, with one exception: A special folder, comparable to the hidden “System Volume Information” folder on an NTFS volume, will be provisioned. This directory is called “SystemShareInformation”. It contains important sync metadata that will not sync to other endpoints. Do not use or delete it!

In the Azure portal, go to your Storage Sync Service, and then select + Sync group

In the pane that opens, enter the following information to create a sync group with a cloud endpoint:

  • Sync group name: The name of the sync group to be created. 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 in Deploy the Storage Sync Service.
  • Storage account: If you Select storage account, another pane appears in which you can select the storage account that has the Azure file share that you want to sync with.
  • Azure file share: The name of the Azure file share with which you want to sync.

Sync group created

Preparing Windows Server to use with Azure File Sync

Install the Azure File Sync agent

For each server that you intend to use with Azure File Sync, including each server node in a Failover Cluster, disable Internet Explorer Enhanced Security Configuration. This is required only for initial server registration. You can re-enable it after the server has been registered.

The Azure File Sync agent is a downloadable package that enables Windows Server to be synced with an Azure file share.

You can download the agent from the Microsoft Download Center.


When the download is finished, double-click the MSI package to start the Azure File Sync agent installation.


I recommend that you do the following:

  • Leave the default installation path (C:\Program Files\Azure\StorageSyncAgent), to simplify troubleshooting and server maintenance.
  • Enable Microsoft Update to keep Azure File Sync up to date. All updates, to the Azure File Sync agent, including feature updates and hotfixes, occur from Microsoft Update. We recommend installing the latest update to Azure File Sync.

When the Azure File Sync agent installation is finished, the Server Registration UI automatically opens. You must have a Storage Sync Service before registering.


Register Windows Server with Storage Sync Service

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 and can sync with other servers and Azure file shares associated with the same Storage Sync Service.

The Server Registration UI should open automatically after installation of 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. When the Server Registration UI opens, select Sign-in to begin.

After you sign in, you are prompted for the following information:

  • Azure Subscription: The subscription that contains the Storage Sync Service.
  • Resource Group: The resource group that contains the Storage Sync Service.
  • Storage Sync Service: The name of the Storage Sync Service with which you want to register.

After you have selected the appropriate information, select Register to complete the server registration. As part of the registration process, you are prompted for an additional sign-in.


Registration Succeed, Copy Azure portal resource link


In the Add server endpoint pane, enter the following information to create a server endpoint:

  • Registered server: The name of the server or cluster where you want to create the server endpoint.
  • Path: The Windows Server path to be synced as part of the sync group.
  • Cloud Tiering: A switch to enable or disable cloud tiering. With cloud tiering, infrequently used or accessed files can be tiered to Azure Files.
  • Volume Free Space: The amount of free space to reserve on the volume on which the server endpoint is located. For example, if volume free space is set to 20% on a volume that has a single server endpoint, roughly half the amount of data is tiered to Azure Files. Regardless of whether cloud tiering is enabled, your Azure file share always has a complete copy of the data in the sync group.

To add the server endpoint, select Create.


Your files are now kept in sync across your Azure file share and Windows Server.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s