2

I need to use a task of az cli in a cloud agent, but need to use an older version, today the version used by default in windows-2019 image is az cli v.2.37.0, but I need az cli v.2.34.1.

How can I set this version in the task ?

Elias Arellano
  • 433
  • 5
  • 16

1 Answers1

2

You can install Azure CLI with the bash task.

# Specify python version
- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.x'
    architecture: 'x64'

# Update to latest Azure CLI version
- bash: pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge
  displayName: 'Upgrade Azure CLI'

You can also specify a version for pip install.

- bash: pip install -Iv azure-cli==2.34.1 --extra-index-url https://azurecliprod.blob.core.windows.net/edge
  displayName: 'Upgrade Azure CLI'
Markus Meyer
  • 3,327
  • 10
  • 22
  • 35