Unable to Register Azure File sync agent RRS feed

  • Question

  • I am getting this error "The term 'Find-AzureRmResource' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." while trying to perform File Sync Agent registration on windows 2016 server. I tried reinstallation  of the agent. Made sure I installed the right powershell version because in powershell 6.0.1, the above command is missing.

    Please help in fixing this.

    Tuesday, May 8, 2018 6:37 PM


  • Hi Eric, the agent update that fixes this is v2.3 so more information would be great.  If you installed the v2.3.1 version (https://www.microsoft.com/en-us/download/details.aspx?id=55988) this problem should not manifest.  Feel free to email me directly at klaasl at microsoft dot com or reply here.

    klaas [Principal PM Manager @Microsoft]

    Wednesday, May 16, 2018 9:21 PM

All replies

  • Find-AzureRmResource cmdlet is only available on below AzureRM Powershell versions. Try to install this AzureRm Powershell versions and let us know the result.

    Tuesday, May 8, 2018 7:56 PM
  • I am also having this exact issue. Would you please be a little bit more specific about which version and how to get this resolved? Thank you!
    Wednesday, May 9, 2018 12:54 AM
  • First run the following Powershell commands, and after try to download and install the Agent

    #Install the PowershellGet Module
    Install-Module -Name PowerShellGet -RequiredVersion -Force 
    #Install the AzureRM Manager
    Install-Module -Name AzureRM -AllowClobber
    #Import the AzureRM Module
    Import-Module -Name AzureRM

    • Proposed as answer by vikranth s Wednesday, May 9, 2018 12:56 PM
    Wednesday, May 9, 2018 7:30 AM
  • thank you very much for the quick response. I'm working on figuring out the following error, but in case you can assist 1st. I can't install because of the following warning

    WARNING: The version '' of module 'PackageManagement' is currently in use. Retry the operation after closing the applications.

    Wednesday, May 9, 2018 12:56 PM
  • I tried so many things, I'm not sure what solved it in the end. However, try -AllowClobber instead of -Force
    Wednesday, May 9, 2018 2:08 PM
  • I'm experiencing the same problem when trying to register a server for Azure File Sync. I followed the MS deployment doc and the server meets the requirements (Server 2012R2, MGMT Framework 5.1, Azure Powershell 6.0). Tried reinstalling StorageSyncAgent.

    Anyone know how to fix this? Thanks!

    Wednesday, May 9, 2018 4:11 PM
  • You have the wrong version of the client. Create a file sync object in azure and go to registered servers. There is a link to get the right version of the client. 

    It is available here. 


    Wednesday, May 9, 2018 9:12 PM
  • Thanks but that's where I downloaded it from. StorageSyncAgent_PreviewRefresh1_WS2012R2.msi

    • Edited by JStiggy Wednesday, May 9, 2018 9:33 PM
    Wednesday, May 9, 2018 9:33 PM
  • I have the same problem, Version of AzureRM module 6.0.0 and 6.0.1 do not have the Find-* commands as these have been merged into Get-* commands , anyway I downgraded to 5.7.0 first which do have Find-* commands and the sync client keep giving me this error, downgraed to 4.3.1 which is the minimum requirement for the module and still to no avail.

    Anyone sovled this ?


    Thursday, May 10, 2018 10:21 AM
  • In the end I was able to solve the problem by doing the registration by powershell


    #Import Azure Storage Sync Module
    Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.PowerShell.Cmdlets.dll"

    #Login to Azure Storage Sync
    Login-AzureRmStorageSync -SubscriptionID "cfxxxxx-7axxx-4xxx-axxx-edxxxxxxxxx" -TenantID "91xxxxx-2xxx-4xxx-8xxx-a1xxxxxxxxx" -Credential $Cred

    Register-AzureRmStorageSyncServer -SubscriptionId "cfxxxxx-7axxx-4xxx-axxx-edxxxxxxxxx" -ResourceGroupName "Resourse Group" -StorageSyncService "FileSync Service Name"

    Thursday, May 10, 2018 10:59 AM
  • You can also uninstall AzureRM then Uninstall AzureRM.Resource then install AzureRM.Resource with -Requiredversion flag, then install azure rm with the requiredversion tag
    Thursday, May 10, 2018 12:56 PM
  • I tried powershell but getting the following error. Also ran the command without -StorageSyncService "FileSync Service Name" and was prompted for filesync service name but same error after entering the name of the filesync service. The file sync service is there but not sure what monitoring data path directory is referring to.

    Register-AzureRmStorageSyncServer : Monitoring data path directory doesn't exist.
    Error Type: 3
    At line:1 char:1
    + Register-AzureRmStorageSyncServer -SubscriptionId "6xxxxxxx-xxxx-xxxx ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Register-AzureRmStorageSyncServer], ServerRegistrationException
        + FullyQualifiedErrorId : Register-AzureRmStorageSyncServer,StorageSync.Management.PowerShell.Cmdlets.RegisterAzur

    Thursday, May 10, 2018 8:06 PM
  • Seeing this error while trying to import 

    PS C:\Users\shashank> Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.PowerShell.Cmdlets.dll"
    Import-Module : Could not load file or assembly 'file:///C:\Program 
    Files\Azure\StorageSyncAgent\StorageSync.Management.PowerShell.Cmdlets.dll' or one of its dependencies. An attempt 
    was made to load a program with an incorrect format.
    At line:1 char:1
    + Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Ma ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], BadImageFormatException
        + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand

    Friday, May 11, 2018 10:14 AM
  • A newer version of AzureRM broke server registration.  We are fixing this asap but in the interim, you can work around this problem via the following steps in PowerShell:

    1. Stop the current ServerRegistration.exe via taskmgr
    2. Bring up a PowerShell command prompt as Administrator
    3. PS C:> Uninstall-Module AzureRM
    4. PS C:> install-module -name AzureRM -RequiredVersion 5.7.0
    5. Start C:\Program Files\Azure\StorageSyncAgent\ServerRegistration.exe.

    This is documented at: https://docs.microsoft.com/en-us/azure/storage/files/storage-sync-files-troubleshoot#during-server-registration-get-the-error-the-term-find-azurermresource-is-not-recognized-as-the-name

    klaas [Principal PM Manager @Microsoft]

    Friday, May 11, 2018 4:21 PM
  • @klaas, not working here FYI.. Win2016, tried with 2.011 and 2.3 agent.

    @Giuseppe, thanks for the hint!  I made a more reusable interactive script in case it helps someone else:


    $azuresubscription = Get-AzureRmSubscription | Out-GridView -PassThru -Title "Select Subscription"
    Select-AzureRmSubscription -SubscriptionId $azuresubscription.SubscriptionID
    $filesyncservice = Find-AzureRmResource | ?{$_.ResourceType -eq "Microsoft.StorageSync/storageSyncServices"} | Out-GridView -PassThru -Title "Select FileSync Service"

    Login-AzureRmStorageSync -SubscriptionID $azuresubscription.SubscriptionID -TenantID $azuresubscription.TenantId
    Register-AzureRmStorageSyncServer -SubscriptionId $azuresubscription.SubscriptionID -ResourceGroupName $filesyncservice.ResourceGroupName -StorageSyncService $filesyncservice.Name

    Wednesday, May 16, 2018 8:33 PM
  • Hi Eric, the agent update that fixes this is v2.3 so more information would be great.  If you installed the v2.3.1 version (https://www.microsoft.com/en-us/download/details.aspx?id=55988) this problem should not manifest.  Feel free to email me directly at klaasl at microsoft dot com or reply here.

    klaas [Principal PM Manager @Microsoft]

    Wednesday, May 16, 2018 9:21 PM