Search code examples
azure-devopsazure-powershell

Az version null not avaiable locally on the agent. Validate-VersionParameters: Cannot convert value 'null' to type 'System.Version'


Facing an issue while trying to run the AzurePowerShell@5 task in Azure devops

Az version null not avaiable locally on the agent. Downloading dynamically.
Validate-VersionParameters: Cannot convert value 'null' to type 'System.Version'
Exception: /home/vsts/work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.218.0/Utility.ps1:94
Line |
94 |  …             throw ("Could not find the module path with given version …
 |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | Could not find the module path with given version.
 [![enter image description here][1]][1]

snapshot of the error


Solution

  • This task requires a parameter azurePowerShellVersion. Provide the value 'Latest' or 'Other'.

    There was a github issue raised for this issue. https://github.com/MicrosoftDocs/azure-devops-docs/issues/11928 .

    The highlighted parameter is required. https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-powershell-v5?view=azure-pipelines

    enter image description here