Hi , hope doing well
To answer your query
Use the Azure CLI Installer Task: If you want to ensure a specific version of the Azure CLI is used in your pipelines, you can use the "Azure CLI Installer" task. This task allows you to specify the version of the Azure CLI to be used in your pipeline. You can include this task at the beginning of your pipeline to ensure that the correct version is available
Here's an example YAML snippet of how you can use the "Azure CLI Installer" task:
- task: UseAzureCLI@2 inputs: azureSubscription: 'YourServiceConnection' scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: | # Install a specific version of Azure CLI curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash -s -- -y --upgrade <desired_version>
Replace <desired_version> with the specific version you want to install, in this case, "2.53.1". This task will ensure that the specified version of the Azure CLI is used in your pipeline.
Please try this and let me know , Thanks!