Unable to configure azure file sync - unauthorized

AndyW 20 Reputation points
2026-12-01T03:57:51.07+00:00

I am trying to install Azure File Sync agent on an Azure Arc enabled machine. I've deployed the agent and am on the Server Registration page. After selecting my subscription, resource group and sync service, clicking 'register' reports "Operation returned an invalid status code 'unauthorized'.

The account I am connected with has Azure File Storage Admin. On the Activity log in the storage service I can see there is a deny policy: 'deny' Policy action' (it does not say anything else here)

However, when I tried another account that also has Azure Files Admin permissions I get RequestDisallowedByAzure - have not authenticated through MFA'.

The account I am using does not have MFA configured (its the account used for storage sync) - I am not sure how the azure file service would do MFA anyhow.

It doesn't appear to be anything to do with IAM - when I use an account that has MFA and go through that process I get the same error.

In the JSON log I can see

policyAssignmentName":"sys.mfa-write"
and
"policyAssignmentDisplayName":"Microsoft Azure Multi Factor Authentication Enforcement for Resource Write Actions"

My subscription is a Visual Studio Enterprise Subscription

Regards

Azure Files
Azure Files

An Azure service that offers file shares in the cloud.

0 comments No comments

Answer accepted by question author

AI answer

2026-12-01T03:58:04.5933333+00:00

For this Azure File Sync registration error, the supported remediation is to bypass the Server Registration UI and register the server manually with PowerShell.

  1. Open an elevated PowerShell session on the server.
  2. Sign in to the correct subscription and tenant:
Connect-AzAccount -Subscription "<your-subscription-guid>" -Tenant "<your-tenant-guid>"
  1. Register the server manually:
Register-AzStorageSyncServer -ResourceGroupName "<your-resource-group-name>" -StorageSyncServiceName "<your-storage-sync-service-name>"
  1. After registration completes, verify that the server appears under Registered servers in the Azure portal.

This specific Unauthorized error during server registration is a known issue with the Azure File Sync v20 agent.

If registration still fails, collect the local registration error details and run the built-in diagnostics:

  1. Check the AfsSrvRegistration*.log file under %LocalAppData%\Temp and search for ErrorMessage.
  2. Run diagnostics:
Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
Debug-StorageSyncServer -Diagnose
  1. Test network connectivity:
Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
Debug-StorageSyncServer -TestNetworkConnectivity

If the agent was installed through the Azure Arc extension, check the extension failure details before reinstalling:

  1. In the Azure portal, open the Arc Server.
  2. Go to Extensions.
  3. Find AzureFileSyncAgentExtension.
  4. Select View Details under Status.
  5. Review the Error Message field.

If the extension deployment failed, uninstall and then reinstall the failed extension only after completing the required remediation. Uninstalling removes the saved error details.

Also confirm that .NET Framework 4.7.2 or later is installed. Azure File Sync server registration requires .NET Framework 4.7.2 or later. After installing it, restart the server and retry registration.


References:

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

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Newest
  1. AndyW 20 Reputation points
    2026-12-01T20:41:35.59+00:00

    Just a follow-up to the accepted answer - the account used in the PowerShell example needs to go through the MFA routine - I suspect some kind of internal flag is set. Once that is done, then the register command will work.

    Was this answer helpful?

    0 comments No comments

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.