小编Fal*_*lco的帖子

如何在自托管 Windows 代理上从 Azure DevOps 管道运行 Azure CLI 任务?

情况

我的自托管 Windows 代理运行来自 Azure DevOps 的管道。为了管理 Azure 中的资源,我想使用 Azure CLI 任务。即使在前面的步骤中安装了 Azure CLI,AzureCLI 任务也会失败。

我有两个从我的管道运行的脚本。

  • (1)安装Azure CLI-->成功
  • (2) 运行 Azure CLI 命令 --> 未运行任何内部代码(甚至“Hello, World!”)而失败 不会被执行。
2021-03-05T14:50:02.5986237Z ##[error]Azure CLI 2.x is not installed on this machine.
2021-03-05T14:50:02.6391547Z ##[error]Script failed with error: Error: Unable to locate executable file: 'az'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for …
Run Code Online (Sandbox Code Playgroud)

powershell azure azure-cli azure-devops azure-pipelines

6
推荐指数
1
解决办法
1万
查看次数