如何在YAML中的Azure Pipelines中为AZ CLI指定版本?

发布于 2025-02-06 08:02:57 字数 123 浏览 3 评论 0原文

我需要在云代理中使用AZ CLI的任务,但需要使用旧版本,如今Windows-2019 Image默认使用的版本是AZ CLI v.2.37.0,但我需要AZ CLI V.2.2.34 .1。

如何在任务中设置此版本?

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒浓于脸红 2025-02-13 08:02:57

您可以使用bash 任务

# 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'

您还可以为 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'

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'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文