At last year's Ignite, Microsoft announced the Azure File Sync (AFS) service that lets you sync your on-premises file shares with Microsoft's cloud. In this post you will learn how to install AFS.

For a long time, system administrators have been struggling with the traditional model of file servers where you need to take care of the capacity, the backup and recovery of the shares, whether the shares are available in other offices or not, and whether it take a long time to access these shares or not.

Azure File Sync (AFS) helps us solve these issues with file shares by:

  • Centralizing your shares in Azure Files
  • Relieving the headache of file server hardware
  • Granting fast access to the shares, since it will cache the data in multiple locations
  • Providing cloud tiering where it will delete the least recently used file shares from your local file server according to the percentage of capacity you want to maintain free on premises—the data is still available on Azure Storage where users can access it
  • No longer requiring you to back up your shares locally, as Azure will handle it

Prerequisites ^

To install the AFS agent, you need to meet the following prerequisites:

  • The supported OS versions of file servers at the moment are Windows Sever 2012 R2 and Windows Server 2016 with Desktop Experience.
  • If you are using Windows Server 2012 R2, make sure that the PowerShell version is 5.1. However, AFS does not support PowerShell 6.0 or higher versions on both versions of Windows Server so far.
  • Create an Azure Storage account with a file share. You can do this with the following cmdlets:
    $SA = New-AzureRmStorageAccount -Name <Specify a name for the storage account> -ResourceGroupName <Specify the resource group> -SkuName <Specify which SKU you want to use> -Location <Specify the nearest Azure region to you>
    New-AzureStorageShare -Name <Specify a file share name> -Context $SA.Context
  • Install the Azure Resource Manager (AzureRM) PowerShell module on the file servers. You can do this with the following PowerShell cmdlet:
    Install-Module AzureRM
  • Turn off Internet Explorer Enhanced Security Configuration for users and admins. This is required for the initial server registration, and you can reenable it again after the server registration. You can do this with the following PowerShell cmdlets:
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0 -Force
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0 -Force

Create the AFS service ^

First, you need to create the AFS service in Azure. You can do this by following this step-by-step guide:

  • Navigate to Azure Portal, open Marketplace, and search for Azure File Sync.
  • When you click on it, a new blade opens up where you have to specify the following:
    • Name: Specify a descriptive name for the service.
    • Subscription: Indicate the subscription to charge for the service usage.
    • Resource Group: Specify the resource group in which this service will exist as a resource.
    • Location: Select the nearest Azure region.
  • Once you are done, click on Create.
  • After creating the file sync service, you need to search for Azure Storage services. You can view the file sync services here.
Searching for Storage Sync Services

Searching for Storage Sync Services

The created AFS services

The created AFS services

Install the agent ^

  1. To download the agent, you can navigate to the created file sync service. Go to Sync -> Registered servers, and Download the AFS agent.
    Download the AFS agent

    Download the AFS agent

  1. Then it will redirect you to the download page. When you click on Download, you need to select the version that suits your Windows Server version.
    Select the executable compatible with your Windows Server version

    Select the executable compatible with your Windows Server version

  1. After downloading the agent, you can start the installation process. This is a very straightforward process with Next -> Next -> Finish

Registering the file servers ^

  1. After finishing the installation, you can proceed with the server registration, which will ask you to sign in to your Azure tenant.
    Signing in to your Azure tenant

    Signing in to your Azure tenant

    1. Once you click on Sign in, it will prompt you to enter the credentials required to log in to your tenant.
    2. After you log in, it will navigate you to the next screen where you need to specify the following:
      1. Subscription: The subscription that charges for AFS
      2. Resource Group: The resource group in which AFS exists as a resource
      3. Storage Sync Service: The AFS service you created
    Specify the Azure sync service subscription, resource group, and the service itself

    Specify the Azure sync service subscription, resource group, and the service itself

  1. Once you are done, click on Register, which will require another sign-in to the tenant.
  2. After finishing the registration, you should receive a success message.
    Completing the registration successfully

    Completing the registration successfully

  1. To verify successful registration of the server, navigate to the file sync service you created earlier. Under SYNC, click on Registered servers, and make sure the servers you registered are in an online state.
    Verifying the server registration

    Verifying the server registration

  1. After that, install the agent on the other file servers you want to sync data with.

Create and configure the sync group ^

Sync group is the service that controls and manages the replication of files between different on-premises nodes and cloud endpoints. Cloud endpoints in this case are the file shares like the one we created earlier.

To create the sync group, follow these steps:

  1. Navigate to the file sync service you created earlier. Under Overview, click Sync Group.
  2. A new blade will open up wherein you have to specify the following:
    1. The sync group name
    2. The subscription in which you created the file share earlier
    3. The storage account you created earlier
    4. The file share you created earlier
  3. After adding the cloud endpoint, you should see it in the same blade.
    Verify the added cloud endpoint

    Verify the added cloud endpoint

After that, you need to do the same for the file servers. To do so, you need to follow these steps:

Subscribe to 4sysops newsletter!

  1. From the same blade, click on Add server endpoint.
  2. A new blade opens up where you have to specify the following:
    1. Registered Server: One of the file servers you installed the agent on
    2. Path: The path of the shared folder
    3. Cloud Tiering: Specify whether to enable or disable it; if you decided to enable it, it will ask you to specify the disk size percentage after which the least used shares will be accessible from the cloud file share but will still be visible to end users as local ones
  3. Do the same for each registered server.
  4. After that, the replication of shares should start.

Conclusion ^

In this article, I've covered one of the coolest new Azure services that should help you in your data protection and business continuity. With this feature, you no longer have to be afraid about your shared folders, because in the worst-case scenario when your file servers are down, your shares are still available in the cloud and available for end-user access.

+1
1 Comment
  1. Prince Cassius 3 years ago

    Awesome work, thanks!

    0

Leave a reply

Please enclose code in pre tags

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

*

© 4sysops 2006 - 2021

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account