'[error]Could not find the modules: 'Az.Accounts' with Version: '3.1.0'
I have a release Pipeline in which I use Azure PowerShell to deploy artifacts into AppServices in Azure. It was working fine around two weeks ago but now failing. I stayed nights troubleshooting and searching around for solution, but no success :(
In the Preferred Azure Powershell Version I have this tip: "
In case of hosted agents, the supported Azure PowerShell Version is: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue). To pick the latest version available on the agent, select "Latest installed version".
"
I installed Az version 3.1.0 with the below command from normal Powershell using Pipeline on the target agent:
Install-Module -Name Az -Scope CurrentUser -RequiredVersion 3.1.0 -AllowClobber -Repository PSGallery -Force -SkipPublisherCheck
I can see Az module 3.1.0 installed successfully when I run Get-InstalledModule.
I tried both Tasks version 4 and 5 that supports Az and tried different versions from supported versions and all are failing with the error "Az.Accounts module not found".
I also tried installing latest version of Az but also failed with the same error.
We are using Hosted agents.
I dont know what is wrong and why VS2017 is showing lower supported versions?
Please help!
I can provide more details if needed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
