Azure Sync Agent - Installation or upgrade is failing

Santhosh Brahmadevara (NON EA SC ALT) 10 Reputation points Microsoft Employee
2026-07-30T13:18:12.1866667+00:00

Azure File Sync Agent upgrade failed.Even we installed new agent update KB from windows update but still it is not updating sync agent can not install agent already another agent version is there.As we got warning like soon agent version 20.0 is expiring.

Azure Storage
Azure Storage

Globally unique resources that provide access to data management services and serve as the parent namespace for the services.


3 answers

Sort by: Most helpful
  1. kagiyama yutaka 4,835 Reputation points
    2026-07-30T15:41:50.7866667+00:00

    You can stop logman.exe from an elevated PowerShell using Stop-Process -Name logman -Force. amd If there are any old data‑collector set still hanging around, clean them up with logman query / logman delete. After that, run the Azure File Sync agent MSI manually — just make sure it’s the Windows Server 2025 package. That lets the update go through without rolling back.

    Was this answer helpful?


  2. Sina Salam 31,296 Reputation points Volunteer Moderator
    2026-07-30T14:37:34.2633333+00:00

    Hello Santhosh Brahmadevara (NON EA SC ALT),

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that your Azure Sync Agent is failing during installation or upgrade.

    The best practice method is to either patch the existing agent using Microsoft Update/Microsoft Update Catalog/AfsUpdater, or, if patching fails, uninstall only the Azure File Sync agent, restart the server, and install the latest OS-specific agent without unregistering the server or deleting server endpoints. - https://learn.microsoft.com/azure/storage/file-sync/file-sync-release-notes

    What you can do is to:

    • Stop attempting to install the new MSI over the existing agent.
    • Check whether the previous update is pending a reboot.
    • Validate whether Auto Update failed because the agent expiration metadata or network connectivity is blocked.
    • Apply the correct Microsoft Update Catalog/MSP package for the server OS, or use Microsoft Update/AfsUpdater.
    • If the update still fails, safely uninstall and reinstall the latest matching OS-specific Azure File Sync Agent without unregistering the server.

    After applying the correct update path, the Azure File Sync agent should upgrade successfully, the expiration warning should clear after the server reports the new agent version, and the existing server registration/sync endpoints should remain intact. Do not unregister the server, because unregistering can break the trust relationship and may cause avoidable sync/tiered-file recovery issues. Microsoft specifically warns not to unregister and re-register during agent/OS upgrade scenarios because this can lead to orphaned tiered files. - https://learn.microsoft.com/azure/storage/file-sync/file-sync-release-notes

    I hope this is helpful. Please! Do not hesitate to let me know if you have any other questions, steps or clarifications.


    Please do not close the thread by upvoting and accepting the answer if any part of it is helpful.

    Was this answer helpful?


  3. AI answer

    2026-07-30T13:18:49.67+00:00

    For an Azure File Sync agent that is on v20.0 and showing an expiration warning, use this path:

    1. Verify whether the server has the expiration metadata applied. Run these commands in an elevated PowerShell session:
         Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
         Get-StorageSyncServer
      
      Check the AgentExpirationDate value.
    2. If AgentExpirationDate is empty or not set, test connectivity.
         Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
         Test-StorageSyncNetworkConnectivity
      
      If connectivity problems are reported, fix those first. Auto Update requires the expiration metadata to reach the server.
    3. Manually install the update if Auto Update or Windows Update did not complete the upgrade. For v20.1:
      • It is available through Microsoft Update for servers currently running v20.0.
      • AfsUpdater.exe does not work for v20.1 installation.
      • Existing installations can be updated by downloading the package from Microsoft Update or Microsoft Update Catalog and installing it manually.
      After extracting the CAB, run from an elevated command prompt:
         msiexec.exe /p packagename.msp REINSTALLMODE=OMUS REINSTALL=StorageSyncAgent,StorageSyncAgentAzureFileSync,StorageSyncAgentGuardFilter,StorageSyncAgentUpdater /qb /l\*v KB5056953.log
      
    4. If the update appears stuck or hangs during install, check for the known Logman.exe issue. Symptoms include:
      • AfsUpdater.exe hangs at installing updates
      • installation hangs at Stopping monitoring agent
      Fix:
      • Open Task Manager
      • End the LogMan process
      • Repeat until all LogMan processes are stopped
      • Let the agent update continue
    5. Check whether a restart is blocking completion. Run:
         Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
         Get-StorageSyncServer
      
      If RebootNeeded is True, restart the server to complete the upgrade.
    6. If installation still fails, review the installer logs. Default log location when installed on C::
         C:\Program Files\Azure\StorageSyncAgent\InstallerLog
      
      Look for:
      • AfsAgentInstall for MSI installs
      • AfsUpdater for MSP update installs
      Search near the end of the log for failure codes such as 1603.
    7. If the server was upgraded to a different Windows Server version, do not try to reuse the old agent package. The Azure File Sync agent package is OS-specific. For an OS upgrade, the supported path is:
      • uninstall the Azure File Sync agent
      • restart the server
      • upgrade Windows Server
      • install the agent package that matches the new OS version
      Do not unregister and re-register the server during the OS upgrade, because that can orphan tiered files.
    8. For expired-agent remediation, avoid these actions:
      • Do not unregister the server
      • Do not uninstall and reinstall the agent as a first fix
      • Do not run Reset-StorageSyncServer
      These actions can break endpoints, lose local sync state, or force a full re-sync.
    9. If there are no connectivity problems and AgentExpirationDate is still not set, contact Azure File Sync support.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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