[英]Has az login stopped working in Ubuntu 20.04?
I have used the azure command line some months back without problems.几个月前我使用 azure 命令行没有问题。 Today I needed to use it again.
今天我需要再次使用它。 Nothing has changed in my system, and I am still using the same organization.
我的系统没有任何变化,我仍在使用同一个组织。
I run az login
from my terminal (Ubuntu 20.04) and I am shown a browser window. I login to my Azure account.我从我的终端 (Ubuntu 20.04) 运行
az login
,我看到一个浏览器 window。我登录到我的 Azure 帐户。 The page replies with:该页面回复:
You have logged into Microsoft Azure, You can close this window. or we will redirect you to the Azure CLI documents in 10 seconds.
您已登录 Microsoft Azure,您可以关闭此 window。或者我们将在 10 秒内将您重定向到 Azure CLI 文档。
The terminal then displays the authentication reply (a long json response).终端然后显示身份验证回复(长 json 响应)。 So far so good.
到目前为止,一切都很好。
Now I try to do something with the azure cli, in this case trigger a pipeline:现在我尝试使用 azure cli 做一些事情,在这种情况下触发管道:
az pipelines run --output table --organization https://dev.azure.com/MyOrg/ --project MyProj --name MyRepo --branch refs/heads/y/branch --open
But it complains with:但它抱怨:
Before you can run Azure DevOps commands, you need to run the login command(az login if using AAD/MSA identity else az devops login if using PAT token) to setup credentials.
在运行 Azure DevOps 命令之前,您需要运行登录命令(如果使用 AAD/MSA 身份则为 az login,如果使用 PAT 令牌则为 az devops login)以设置凭据。 Please see https://aka.ms/azure-devops-cli-auth for more information.
有关详细信息,请参阅https://aka.ms/azure-devops-cli-auth 。
This was not the case some months back.几个月前情况并非如此。 What happened here?
这里发生了什么?
This is my az
cli:这是我的
az
cli:
» az --version
azure-cli 2.34.1
core 2.34.1
telemetry 1.0.6
Extensions:
azure-devops 0.18.0
Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
Python location '/opt/az/bin/python3'
Extensions directory '/home/theuser/.azure/cliextensions'
Python (Linux) 3.8.12 (default, Mar 2 2022, 07:26:21)
[GCC 9.3.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
I have tried the same,to upgrade my CLI version
and it failed several times and now only got succeed the error might be you are getting due to some recent changes still going on with 2.34.1 version
.我试过同样的方法,升级我的
CLI version
,它失败了几次,现在只成功了错误可能是由于2.34.1 version
仍在进行的一些最近的更改。
Would suggest you use the old version of CLI and then check or, for Workaround you can use az devops login
using PAT token
.建议您使用旧版本的 CLI,然后检查,或者,对于解决方法,您可以使用
az devops login
using PAT token
。
You can refer the same document to login with PAT
which one you are getting in an error.您可以参考相同的文档以
login with PAT
您遇到的错误。
For more information please refer this GitHub issue as suggested by @ wiruzman有关更多信息,请参阅@wiruzman 建议的 GitHub问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.