简体   繁体   English

AZ CLI 使用服务主体登录从特定计算机失败

[英]AZ CLI login using Service Principal fails from specific computer

I have posted previously about az login using a Service Principal failing with the error No subscriptions found and I have run across others that have had similar issues.我之前发布过关于使用服务主体az login失败并出现错误No subscriptions found并且我遇到了其他有类似问题的人。 Capability seems shaky for some reason.出于某种原因,能力似乎不稳定。 What I am seeing now that has me scratching my head is when I run a script I have that does an az login with a service principal from my desktop computer it works fine...no issues.我现在所看到的让我摸不着头脑的是,当我运行一个脚本时,我使用台式计算机上的服务主体进行az login ,它工作正常……没有问题。 When I run the same script from my laptop, the login fails with the No subscriptions found error.当我从笔记本电脑运行相同的脚本时,登录失败并显示未No subscriptions found错误。 What I have tried on the laptop:我在笔记本电脑上尝试过的:

  • Checked AZ CLI version...same as desktop检查 AZ CLI 版本...与桌面相同
  • Ran az account clear to make sure everything was cleared out运行az account clear以确保所有内容都已清除
  • Deleted Service Principal from AAD and recreated from laptop从 AAD 删除服务主体并从笔记本电脑重新创建

I even ran az account clear on my desktop to make sure it was not working simply because it was cached and even after the clear, the az login worked fine.我什至在我的桌面上运行az account clear以确保它不能仅仅因为它被缓存而工作,即使在清除之后, az login也能正常工作。

Any thoughts on what might be causing this?关于可能导致这种情况的任何想法?

I have posted resolution for this under following thread.我已经在以下线程下发布了解决方案。 https://stackoverflow.com/a/66108965/1712969 https://stackoverflow.com/a/66108965/1712969

you might want to try command with this flag "--allow-no-subscriptions"您可能想尝试使用此标志“--allow-no-subscriptions”的命令

您需要为服务原则分配一个角色,或添加标志--allow-no-subscriptions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 服务主体 az cli 登录失败 - 未找到订阅 - Service Principal az cli login failing - NO subscriptions found 登录到 azur cli 以获取服务主体 - Login into azur cli for a service principal 服务主体(Azure 应用程序多租户)是否可以使用 AZ CLI 向租户中的应用程序授予管理员许可? - Can a service principal (Azure Application multi-tenant) grant admin consent to application in tenant using AZ CLI? az login 命令失败 - Azure cli - az login command fails - Azure cli 在 az cli 中向 Azure 服务主体授予安全读取器角色 - Grant Security Reader role to an Azure Service Principal in az cli 即使在机密到期后,az login 使用服务主体也能正常工作的任何情况? - any situation where az login using Service principal works even after secret expiry? 带有特定租户的az cli登录会生成错误 - az cli login with specific tenant generates error 在 Azure DevOps 管道中,如何使用 addSpnToEnvironment 参数返回的服务原理详细信息登录 AZ CLI? - In Azure DevOps pipelines, how do I login to AZ CLI using the service principle details returned from the addSpnToEnvironment parameter? 使用 az cli 创建的服务连接不起作用 - service connection created using az cli not working az 登录从 github 操作任务失败 - az login fails from github action task
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM