我已在Windows 2019自托管代理上安装了最新版本的Azure CLI。检查版本时输出。
PS C:\Users\blahblah> az --version
azure-cli 2.3.1
command-modules-nspkg 2.0.3
core 2.3.1
nspkg 3.0.4
telemetry 1.0.4
Extensions:
azure-devops 0.18.0
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\builduser\.azure\cliextensions'
Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
然后在devops azure管道发行版中运行相同的脚本时:
2020-04-18T03:50:14.3974844Z ##[debug]which 'az'
2020-04-18T03:50:14.3981389Z ##[debug]found: 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd'
2020-04-18T03:50:14.3981785Z ##[debug]which 'az'
2020-04-18T03:50:14.3985125Z ##[debug]found: 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd'
2020-04-18T03:50:14.3988433Z ##[debug]C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd arg: --version
2020-04-18T03:50:14.3989115Z ##[debug]C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd arg: --version
2020-04-18T03:50:14.3998697Z ##[debug]exec tool: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
2020-04-18T03:50:14.3998969Z ##[debug]exec tool: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
2020-04-18T03:50:14.3999139Z ##[debug]arguments:
2020-04-18T03:50:14.3999314Z ##[debug]arguments:
2020-04-18T03:50:14.4000072Z ##[debug] --version
2020-04-18T03:50:14.4000425Z ##[debug] --version
2020-04-18T03:50:14.4017396Z [command]C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" --version"
2020-04-18T03:50:17.1212688Z azure-cli 2.3.1
2020-04-18T03:50:17.1213010Z
2020-04-18T03:50:17.1213120Z command-modules-nspkg 2.0.3
2020-04-18T03:50:17.1213248Z core 2.3.1
2020-04-18T03:50:17.1213345Z nspkg 3.0.4
2020-04-18T03:50:17.1213451Z telemetry 1.0.4
2020-04-18T03:50:17.1213507Z
2020-04-18T03:50:17.1213631Z Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
2020-04-18T03:50:17.1214799Z Extensions directory 'C:\windows\ServiceProfiles\NetworkService\.azure\cliextensions'
2020-04-18T03:50:17.1214873Z
2020-04-18T03:50:17.1215003Z Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
2020-04-18T03:50:17.1215081Z
2020-04-18T03:50:17.1215191Z Legal docs and information: aka.ms/AzureCliLegal
2020-04-18T03:50:17.1215271Z
2020-04-18T03:50:17.1215320Z
2020-04-18T03:50:17.1215369Z
2020-04-18T03:50:17.1215468Z Your CLI is up-to-date.
2020-04-18T03:50:17.1215525Z
2020-04-18T03:50:17.1215623Z Please let us know how we are doing: https://aka.ms/clihats
请注意发布管道如何不显示我安装了azure-devops扩展。我需要此扩展来远程触发管道发布创建。我已经三倍和四倍地检查我正在比较同一台服务器。
我的下一步是添加一个步骤,以在调用az管道之前安装Azure CLI扩展。但是,我宁愿尝试找出为什么这不起作用。我已经在本地拨打了相同的电话,并且效果很好。但是,在本地测试同一呼叫时,我以自己的身份登录,而不是使用服务主体/服务订阅。
有人遇到这个问题,知道发生了什么吗?任何建议将不胜感激。
答案 0 :(得分:1)