0
votes

Normal VSO release should work with the 'Azure Pipelines' agent. But it is failing in Azure Powershell task saying 'Could not find the modules: 'Az.Accounts'.. While same task is running with the 'Fortify' agent

Tried all possible agents other than 'Fortify'. Didn't work.

2
Can you share your script?Shayki Abramczyk
@Kaustubh How is it going with this case, Any update?Levi Lu-MSFT

2 Answers

1
votes

I had the same problem with version 4 of the task. I switched to 3 and it got fixed.

0
votes

I came across a similar error using task Azure Powershell "Could not find the modules: 'Az.Accounts' with Version: '5.1.1' If the module was recently installed, retry after restarting the Azure Pipelines task agent".

My fix to this error is to use the latest version of azurePowerShellVersion,

azurePowerShellVersion: 'latestVersion'

For classic view:

select the latest version 4.* of task Azure Powershell

enter image description here

check latest installed verison for azure powershell version

enter image description here

If above fix does not work for you. For better troubleshooting, please post the full error message and the detailed settings of Azure Powershell task.