- EC2 Image Builder: Build your golden VM images on AWS - Wed, Jan 19 2022
- Configuring DFS Namespaces for Amazon FSx for Windows file servers - Fri, Jan 7 2022
- AWS Systems Manager Session Manager: Securely connect EC2 instances - Wed, Dec 22 2021
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.
Install the agent ^
- To download the agent, you can navigate to the created file sync service. Go to Sync -> Registered servers, and Download the AFS agent.
- 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.
- After downloading the agent, you can start the installation process. This is a very straightforward process with Next -> Next -> Finish
Registering the file servers ^
- After finishing the installation, you can proceed with the server registration, which will ask you to sign in to your Azure tenant.
- Once you click on Sign in, it will prompt you to enter the credentials required to log in to your tenant.
- After you log in, it will navigate you to the next screen where you need to specify the following:
- Subscription: The subscription that charges for AFS
- Resource Group: The resource group in which AFS exists as a resource
- Storage Sync Service: The AFS service you created
- Once you are done, click on Register, which will require another sign-in to the tenant.
- After finishing the registration, you should receive a success message.
- 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.
- 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:
- Navigate to the file sync service you created earlier. Under Overview, click Sync Group.
- A new blade will open up wherein you have to specify the following:
- The sync group name
- The subscription in which you created the file share earlier
- The storage account you created earlier
- The file share you created earlier
- After adding the cloud endpoint, you should see it in the same blade.
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!
- From the same blade, click on Add server endpoint.
- A new blade opens up where you have to specify the following:
- Registered Server: One of the file servers you installed the agent on
- Path: The path of the shared folder
- 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
- Do the same for each registered server.
- 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.
Awesome work, thanks!