Azure File Sync is not working bi-directional

ASY ASY 25 Reputation points
2025-06-17T03:04:11.01+00:00

User's image

I have a third party application which runs on an on-premises windows server. This application generates.xml files and places them to a folder on the same server.

And I have an Azure Function to pick up those files, process them and move to an archive folder on the same on-premises server.

Folder path where xml files are generated: D:\XMLFiles\

The archive folder my azure function writes back: D:\XMLFiles\XMLArchive\

The requirement is to be able to detect when a new file is created on the server (D:\ XMLFiles) and pick for my Azure function processing on a near real time basis. And once the file is processed. Move it to archive (D:\XMLFiles\XMLArchive).

I've followed the document to deploy Azure File Sync

1- I've installed Azure File Sync agent on the on premises server.

2- I've created an Azure Storage Sync Service in Azure Portal.

3- I've registered my server with Azure Storage Sync Service

4- I've created an Azure Storage account with a File Share.

5- I've created a Sync Group under Azure Storage Sync Service:

 - Cloud Endpoint: Azure File Share

 - Server Endpoint: my on premises server.

I've developed an azure function periodically scan the Azure File Share that is set up above.

When xml files are generated on my windows server, I can see that it is replicated in my Azure File Share near real time. So this works good.

But when my function writes files to archive from Azure end (through Azure File Share) I don't see those files are replicated to the Windows Server.

Is this the normal behavior of Azure File Sync Agent?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,420 questions
{count} votes

Accepted answer
  1. Nandamuri Pranay Teja 3,610 Reputation points Microsoft External Staff Moderator
    2025-06-17T04:06:40.53+00:00

    Hello ASY ASY

    Please be informed that that the D:\XMLFiles\XMLArchive\ folder on your on-premises server is not correctly considered part of the Server Endpoint's synchronized scope. Because when you configure a Server Endpoint, you define a specific local path on your server that Azure File Sync will monitor and synchronize. All subdirectories and files within that specified path should be included in the sync.

    • Go to your Azure Storage Sync Service and Navigate to your Sync Group.
    • Under the "Server endpoints" section, click on the entry for your on-premises server.

    Look at the "Path" field.

    • Is it precisely D:\XMLFiles? If it is, then D:\XMLFiles\XMLArchive\ is a subdirectory, and it should sync. Is it D:\ or some other parent folder, and XMLFiles is a subfolder? If so, then D:\XMLFiles\XMLArchive\ should still be covered.
    • Is there any chance the Server Endpoint was configured only for D:\XMLFiles and the XMLArchive folder was later created outside its perceived scope, or there's a misunderstanding of how subdirectories are handled? (Unlikely if it's a direct subfolder, but worth confirming).

    Post which Examine Azure File Sync Agent Logs on the On-Premises Server:

    • On your Windows Server, open Event Viewer.
    • Navigate to Applications and Services Logs -> Microsoft -> FileSync -> Sync.
    • Look for any warning or error events related to download or synchronization. These logs will tell you if the agent is even attempting to download changes for that archive folder and why it might be failing.

    Why it's Not Normal Behavior and What to Expect?

    If D:\XMLFiles\XMLArchive\ is indeed a subfolder of your configured Server Endpoint path (e.g., D:\XMLFiles), then any files placed into /myfileshare/XMLArchive/ via your Azure Function should absolutely sync down to D:\XMLFiles\XMLArchive\ on your server.

    • Confirm it encompasses the D:\XMLFiles\XMLArchive\ directory. diagnosing why the download isn't happening. Look for specific error messages or warnings in the Sync event logs.
    • If all configurations look correct and logs don't immediately reveal a clear issue, consider restarting the Azure File Sync Agent service on your on-premises server to force a rescan. (Search for "Services" -> find "Azure File Sync Agent" -> Restart).

    References:

    1. https://learn.microsoft.com/en-us/troubleshoot/azure/azure-storage/files/file-sync/file-sync-troubleshoot
    2. https://learn.microsoft.com/en-us/azure/storage/file-sync/file-sync-deployment-guide?tabs=azure-portal%2Cproactive-portal

    Hope the above answer helps! Please let us know do you have any further queries.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members. 

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.