Azure File Sync Is Now Generally Available (GA) #Azure #AzureFiles #AzureFileSync #WindowsServer #AFS

Updated – 08/15/2018 – Added Update Rollup for Azure File Sync Agent (KB4456224).

Updated – 07/22/2018 – Added Server Core support is coming to Azure File Sync.

Introduction

You have a lot of files, and all are pilling up in scattered branch offices, that are difficult to manage, backup and recover. You can consolidate your files in the cloud, but on-premises users and applications might struggle with the slower access times. At Ignite 2017 in September last year, Microsoft announced the public preview for Azure File Sync (AFS) which can help you to extend your on-premises file servers to Azure. In less than a year, Microsoft today made Azure File Sync (AFS) generally available.

Azure File Sync was built based on the following common problems:

  • On-premises hardware management is a major pain both in terms of hardware being very expensive, but also in terms of managing disks and storage.
  • Capacity management was another problem, and most IT admins want to keep everything on their file servers without deleting any data.
  • Managing global infrastructure, and managing projects that span multiple sites is challenging and very complex, because the global access is just a fact of day to day life.

What is Azure File Sync

With Azure File Sync, you can now centralize your files in Azure and then install Azure File Sync agent on a Windows Server on-premises to provide fast local access to your cloud files. Your local server and Azure are constantly syncing, so you have one centralized location for your files with multi-site access powered by fast local caches and cloud tiering. What Cloud Tiering does is, it over time builds up a heat map on your disks of what files are being used, what files are being written to, and then as the disks become full, the files will be moved to the cloud and keep only stubs (namespace) on the disks locally, and when the user clicks on the file, it will download seamlessly from the cloud rather than opening straight from disks. And this is obliviously desirable for those files that you are not using very often but you still want them to be around.

If a server becomes unavailable on-premises for any reason, you just need to install Azure File Sync on another server or virtual machine, and your users and applications can access the file again within minutes. With the integration of Azure Backup service, you can protect your data in the cloud without worrying about on-premises backup solutions. And if you want to move an application to the cloud, your App can access the Azure File share just like a local file share in your network. With Azure File Sync, you get the benefits of consolidating your files in the cloud, matched with the performance of a local file server.

Azure File Sync is a hybrid solution that is built on top of the Azure Platform as a Service (PaaS) and Azure Files.

In this blog post, I will show you how to quickly get started with Azure File Sync (AFS) to extend on-premises file servers to the cloud.

Prerequisites for Azure File Sync

Before we get started, there are few prerequisites that you need to verify.

On-premises

As of this writing, the supported versions of Windows Server by Azure File Sync are:

  • Windows Server 2019 (Datacenter and Standard) – Server with Desktop Experience
  • Windows Server 2016 (Datacenter and Standard) – Server with Desktop Experience
  • Windows Server 2012 R2 (Datacenter and Standard) – Server with Desktop Experience

Updated: Microsoft confirmed that Server Core support is coming to Azure File Sync as well. The reason why the delay is because you need to login with a username/password to the AzureRM module, and this doesn’t do the right thing today because Server Core lacks the ability to pop IE login (i.e. it’s the AzureRM PowerShell module’s issue, not Azure File Sync). Technically, you can use AFS with Server Core if you use an Azure Active Directory (AAD) service principal to register the server. But Microsoft felt this was an unacceptable compromise so they are working with the AzureRM team to have the device authentication experience you have in AzureCLI today for AzureRM PowerShell.

PowerShell version 5.1 is the minimum required for Azure File Sync. If you are using Windows Server 2012 R2, then you need to ensure to install at least PowerShell 5.1. You can safely skip this check on Windows Server 2016 and Windows Server 2019.

On Azure

As of this writing, Azure File Sync is only available in 14 regions. Microsoft will continue to add support for more regions in the near future. You can check region availability here.

  • Australia East
  • Australia Southeast
  • Canada Central
  • Canada East
  • Central US
  • Central India
  • East Asia
  • East US
  • East US2
  • North Europe
  • South India
  • Southeast Asia
  • UK South
  • UK West
  • West Europe
  • West US

Last, you need to create a storage account in Azure, and then create a file share on top of that storage account.

Deploy Azure File Sync

In the following section, I will describe the required steps to automate and deploy Azure File Sync with PowerShell. The same steps can be accomplished through the UI and the Azure Portal.

Step 1 – Prepare Windows Server on-premises to use with Azure File Sync

Open an elevated PowerShell console and run the following command to disable the Internet Explorer Enhanced Security Configuration for Administrators and Users. This is required only for initial server registration in Step 5.

You can re-enable it by updating the Value to 1 after the server has been registered with Azure File Sync.

Step 2 – Download Azure File Syn Agent

The next step is to download Azure File Sync agent. Open an elevated PowerShell console on Windows server and run the following command. This will download the appropriate Azure File Sync agent based on your Operating System version (Windows Server 2012 R2, Windows Server 2016, and Windows Server 2019).

Note: As of this writing, you can install Azure File Sync agent version 2016 on Windows Server 2019 preview builds, however, Microsoft do not support this configuration in production, so please only use it with test data. Windows Server 2012 R2, and Windows Server 2016 are fully supported in production as of today.

In August 2018, Microsoft released an update for the Azure File Sync agent which address the issue with sync sessions fail out of memory error (0x8007000e) due to memory leak. Please make sure to install the Update Rollup for Azure File Sync Agent, the installation instructions are documented here KB4456224.

Step 3 – Install Azure File Sync agent

The next step is to install the Azure File Sync agent. Open an elevated PowerShell console on your Windows server and run the following command.

The Azure File Sync agent consists of three main components:

  • FileSyncSvc.exe: The background Windows service responsible for monitoring changes on Server Endpoints and initiating sync sessions to Azure.
  • StorageSync.sys: The Azure File Sync file system filter, responsible for tiering cold files to Azure Files (when cloud tiering is enabled).
  • PowerShell management cmdlets: PowerShell cmdlets for interacting with the Microsoft.StorageSync Azure Resource Provider. The cmdlets can be found at the following locations (by default):
    • %ProgramFiles%\Azure\StorageSyncAgent\StorageSync.Management.PowerShell.Cmdlets.dll
    • %ProgramFiles%\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll

Step 4 – Deploy the Storage Sync Service in Azure

The next step is to create the Storage Sync Service in Azure, but before doing that you need to create the Azure File Sync context.

Open an elevated PowerShell console on your Windows server and run the following script.

Do not close the PowerShell window after running the script above, this will help to run subsequent Azure File Sync PowerShell commands in the next steps with minimal repetition of parameters and authentication.

Step 5 – Register Windows Server with Storage Sync Service

In this step, you need to register your server on-premises with Azure Storage Sync Service. Open an elevated PowerShell console on your Windows server and run the following command.

Registering your Windows Server with a Storage Sync Service establishes a trust relationship between your server on-premises and the Storage Sync Service in Azure. If you are deploying Azure File Sync on a node which is member of a Failover Cluster, then you need to repeat the same steps described above on each server node in a Failover Cluster.

Step 6 -Create a Storage account and file share

As mentioned earlier in this article, we need to create a storage account and file share in Azure before we start syncing. Open an elevated PowerShell console and run the following script.

Step 7- Create a Sync Group

In this step, we need to create a sync group. A sync group is the basic topology unit of Azure File Sync, it defines the relationship of a sync partnership.

Open an elevated PowerShell console and run the following command.

Step 8 – Create a cloud endpoint

In this step, we need to create a cloud endpoint. A cloud endpoint is a pointer to an Azure file share. All server endpoints (Step 9) will sync with a cloud endpoint, making the cloud endpoint the hub.

Open an elevated PowerShell console and run the following command.

Step 9 – Create a server endpoint

In the last step, we need to create a server endpoint. A server endpoint represents a path on a registered server on disk on-premises, such as a folder on a server volume. The path must be on a non-system volume if you plan to enable Cloud Tiering. Cloud Tiering cannot be enabled on the system volume.

Open an elevated PowerShell console on the registered server and run the following script.

Testing Azure File Sync

Now you have Azure File Sync deployed and ready to use. You can copy some files to the server endpoint under the path specified in Step 9. Based on your Internet bandwidth and the size of the files, storage sync will automatically kick off behind the scene and the files will be synced to Azure File share as shown in the following screenshot.

Since I enabled cloud tiering and I set the volume of free space percentage to maximum 100%.

All the files have been tiered to Azure file share. The following screenshot shows the actual size of the file and the size locally on disk.

 

And there you have it.

Summary

Azure File Sync extends on-premises files servers into Azure providing cloud benefits while maintaining performance and compatibility.

Azure File Sync provides:

  • Multi-site access – provide write access to the same data across Windows servers and Azure Files.
  • Cloud tiering – store only recently accessed data on local servers.
  • Integrates with Azure backup – no need to back up your data on-premises.
  • Fast disaster recovery – restore file metadata immediately and recall data as needed.

I hope you find this article useful.

__
Thank you for reading my blog.

If you have any questions or feedback, please leave a comment.

-Charbel Nemnom-

About Charbel Nemnom 391 Articles
Charbel Nemnom is a Cloud Solutions Architect and Microsoft Most Valuable Professional (MVP), totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 17 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.