Azure – You can trigger Azure File Sync synchronization when changes are done on Azure side

As you may already know, you can synchronize your on-premises file shares to Azure File Share using Azure File Sync.

While changes made on your on-premises side are quickly synchronized to Azure File Share, this is not the same story when changes are made from Azure File Share; you have to wait the 24 hours window to get the changes synchronized back to your on-premises.

Well, good new, while Microsoft is working to improve the Azure to on-premises sync process, you can manually trigger a sync from Azure File using a PowerShell command

Invoke-AzStorageSyncChangeDetection -ResourceGroupName “<resource group where you Azure File share is hosted>” -StorageSyncServiceName “<your Azure Storage sync service>” -SyncGroupName “<your synchronization group name>” -CloudEndpointName “myCloudEndpointName” –DirectoryPath “<path to the updated data relative to the root of your Azure File share>” –Recursive

You can define multiple path in the Path parameter using a comma separated like “path1”,”path2”,”path3”; the path can be a folder or a specific file.

The Recursive parameter is used when the Path is a folder to ask detect any changes (up to 10 000) in the subdirectories.

Leave a Comment

Your email address will not be published.