I keep getting a "Could not find the module Az.Accounts with given version." error with a very simple DevOps release pipelines

Steve Mandras 21 Reputation points

I'm testing a very simple release pipeline that simply copies part of a project's repo in Azure DevOps to an Azure Windows VM. I've gone through the Deployment Group setup several times, registering and installing the agent, along with installing the PowerShell Az module and removing AzureRM. I keep getting this error:

##[error]Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.

I've also tried installing PowerShell 7.3.2 and installing the Az module there.

Any ideas or pointers to docs? Searching for the above error brings me to some cryptic stackoverflow pages that don't really help.

Here's the YAML for the actual task that does the copy- thanks in advance for any pointers or suggestions (as I am clearly new to this!).

- task: AzureFileCopy@5
  displayName: 'AzureVMs File Copy'
    SourcePath: '$(System.DefaultWorkingDirectory)/_XXX_XXX_XXX/Code'
    azureSubscription: 'XXX'
    Destination: AzureVMs
    storage: XXX
    resourceGroup: 'XXX'
    MachineNames: XXX
    vmsAdminUserName: XXX
    vmsAdminPassword: 'XXX'
    TargetPath: 'C:\XXX\XXX\Staging'

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
328 questions
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 25,626 Reputation points Microsoft Vendor

    Hi @Steve Mandras

    Welcome to Microsoft Q&A! 

    Azure DevOps is currently not supported in the Microsoft Q&A, you can ask in the dedicated Azure DevOps forum over here:


    Thanks for your understanding!



    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful