Azure File Sync helps you save on storage capacity by centralizing your files in Azure and then install a sync agent on Windows Server on-premises or in Azure (IaaS VM) 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. Cloud tiering enables frequently accessed files to be cached locally such that the full file content is present on the server, whereas less frequently accessed files are tiered to the cloud. The tiered files (AFS reparse points) will be recalled on-demand when a user or application accesses it on the local server. This is desirable for those files that you are not using very often but you still want them to be around.
For more information about Azure File Sync, please check the following step-by-step guide on how to get started with Azure File Sync and PowerShell.
Last year, Microsoft announced the general availability of Azure Premium Files powered by large file shares (100 TiB). Azure premium files provide fully managed file services optimized to deliver consistent performance. It’s designed for IO intensive enterprise workloads that require high throughput and a single-digit millisecond latency.
For more information about Azure premium files, please check the announcement by Microsoft here.
A quick note about the cost, at the time of writing, the price for 1 GiB Standard file storage is around $0.06 per month for used capacity in West Europe, however, the price for the Premium tier is based on provisioning capacity which is around $0.29 for 1 GiB per month, so as you can see it’s way more expensive than the Standard file tier. The Premium storage is billed on provisioned size of shares, which is specified by the quota on the shares. The Standard storage is billed on used size of shares.
You already have an Azure File Sync deployment against a standard file share, and now you decided to move to Azure premium file share. In this article, I will share with you how to convert an existing Azure File Sync from standard file share to Azure premium file share.
Before you proceed and start the migration as described below, I highly recommend looking at when Azure Premium Files is a good fit for Azure File Sync.
At the time of writing this article, you cannot directly convert between a standard file share and a premium file share. If you would like to switch to either tier, you must create a new file share in that tier and manually copy the data from your original share to the new share you created.
The steps to move a registered server with Azure File Sync from standard file share to premium file share are the following:
- On the server where Azure File Sync agent is installed, this might be on-premises or in Azure (IaaS VM), you need to recall all cloud tiered files. If cloud tiering is NOT enabled, then you can skip this step.
- In the Azure Portal:
- Remove the desired server endpoint from the Sync Group.
- Remove the cloud endpoint from the Sync Group.
- Create a new storage account with premium performance and file storage account.
- Provision of a new Azure file share (i.e. staging) in the premium file storage account.
- Provision a second Azure file share (i.e. production) in the premium file storage account.
- Copy the existing data from the standard file share to the new premium (staging) file share.
- Create a new Sync Group by choosing the premium file storage account and the (production) file share.
- Add the server endpoint to the new Sync Group and enable Offline Data Transfer.
- Finally, delete the premium (staging) file share.
Please note that the same steps will apply as well to convert Azure File Sync from premium file share to standard file share.
In this example, I have a server endpoint with 7.23 GiB already configured and synced to a standard Azure file share.
How to do it…
Login to the server where Azure File Sync agent is installed and run the following PowerShell script locally on the server:
Set-Location "C:\Program Files\Azure\StorageSyncAgent\" Import-Module .\StorageSync.Management.ServerCmdlets.dll -Verbose Invoke-StorageSyncFileRecall -Path "D:\Documents"
As mentioned earlier, if you are not using cloud tiering, then you can skip this step. In the example below, cloud tiering is disabled, thus the Number Of Files Recalled is 0.
The next step is to remove the server endpoint from the existing Sync Group by typing the FQDN name of the server.
Next is to delete the cloud endpoint (Azure File Share) from the existing Sync Group. As shown in the screenshot below, deleting this Cloud Endpoint does not delete the underlying Azure File Share.
Next is to create a new storage account with Premium performance and File Storage account (Note that the Subscription ID has been intentionally obscured in this figure). You can skip this step if you already have an existing premium file storage account.
Next is to provision two premium file shares. The first one will be the staging file share where I will copy the data from the standard file share, and the second one is the final (production) file share where the server endpoint will be connected. In this way, if the file exists in the staging file share, the sync process copies the file from the staging share to the production file share rather than uploading it from the server. Thus, you will save on time and bandwidth.
Please note that Premium file shares are provisioned based on a fixed GiB/IOPS/throughput ratio. For each GiB provisioned, the share will be issued one IOPS and 0.1 MiB/s throughput up to the max limits per share. The minimum allowed provisioning is 100 GiB with min IOPS/throughput. In this example, I will provision 2 X 1 TiB file shares (staging/production).
Repeat the step below twice for staging and production file share.
Next is to copy the existing data from the standard file share to the new premium (staging) file share. This step is very important. So instead of syncing all the data again from your server to the Azure File Share, you can save time and copy/move the data between the standard file share to the premium (staging) file share. Please note that the same steps will apply if you are converting from premium file share to standard file share.
In this example, I will automate this process and copy the data using the AzCopy tool as documented here.
To copy an entire account data from one file share account with Shared Access Signature (SAS) tokens to another file share account with SAS, you can use the following syntax. This command will go through all files and folders from one file share account in recursive mode and copy all the contents to the second file share account.
Jump into Azure Cloud Shell session and run the command below, AzCopy is included as part of the cloud shell.
azcopy copy "https://[sourceaccount].file.core.windows.net/[StandardFileShare]/?[SAS]" "https://[targetaccount].file.core.windows.net/[PremiumStagingFileShare]/?[SAS]" --recursive=true
The output will show the Total Number of Transfers which are 65 files, as well as the time in Minutes. Transferring 7.2 GiB took less than one minute. (Note that the storage account name has been intentionally obscured in this figure).
Now the number of files in the standard file share and the premium (staging) file share are identical, this makes the existing server (endpoint) ready to move (sync fast) to the new premium file share.
Next is to create a new Sync Group in your existing Storage Sync Service by choosing the premium file storage account that you created earlier and make sure to select the Azure File Share production. (Note that the Subscription ID has been intentionally obscured in this figure).
Finally, add the registered server to the premium file share (cloud endpoint) and set the Offline Data Transfer to Enabled. Then select the premium (staging) file share that you provisioned. Please note that the data that you copied to the Azure premium (staging) file share must reside in the same storage account as the cloud endpoint in this sync group.
Offline Data Transfer can only be enabled when creating a new server endpoint. When ready click Create.
After you create the server endpoint, the sync will start. The sync process determines whether each file on the server also exists in the staging share where you copy the files as shown in the previous step. If the file exists locally on the server, the sync process copies the file from the staging file share rather than uploading it from the server which can save a huge amount of time. If the file doesn’t exist in the staging share, or if a newer version is available on the local server, the sync process uploads the file from the local server to the Azure Premium (production) file share.
The server endpoint will start provisioning and after a few minutes, the sync process starts copying the files from the staging premium file share to the production premium file share. The server endpoint will move from Pending to Healthy state.
Last but not least, you can delete the premium (staging) file share and save on cost as well.
That’s it there you have it.
As described in this article, you can move easily synced data between two different file share performance tiers (standard/premium) without re-uploading your data from the local server again.
Azure File Sync extends on-premises file servers into Azure by 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 the local server(s) and save on capacity storage.
- 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 guide useful. To learn more about Azure File Sync, please check the following guides.
Thank you for reading my blog.
If you have any questions or feedback, please leave a comment.