0

要在 Azure CLI 中执行 ACR 命令,我们需要升级 AZ CLI。需要在 YML 中有完整的步骤才能在管道中执行 AZ 命令。

4

1 回答 1

0

请参考链接:https ://docs.microsoft.com/en-us/azure/devops/cli/azure-devops-cli-in-yaml?view=azure-devops

对于 Linux:azure-pipelines-steps-linux.yml:

脚步:

更新到最新的 Azure CLI 版本。

  • 脚本: pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge displayName: '升级 azure cli'

  • 脚本:az --version displayName:'显示 Azure CLI 版本'

  • 脚本:az extension add -n azure-devops displayName:'安装 Azure DevOps 扩展'

  • 任务:AzureCLI@2 输入:azureSubscription:'AzureServiceConnection' scriptType:bash scriptLocation:'inlineScript' inlineScript:| az 帐户显示

于 2021-05-07T05:50:53.870 回答