gpt4 book ai didi

azure - 无需手动交互即可登录 Az

转载 作者:行者123 更新时间:2023-12-02 05:54:48 25 4
gpt4 key购买 nike

我正在尝试在 powershell 脚本中自动执行 azure 登录,为此,我按照 Microsoft 文档 here 中的建议使用以下命令:

az login --tenant <tenant> --use-device-code

但是脚本在这里暂停,并出现以下警告,要求我们打开浏览器并输入代码。

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <code> to authenticate.

如何在 powershell 脚本中自动登录?

编辑:这篇文章的目的是了解 --use-device-code 的工作原理并使其按预期工作。

最佳答案

这就是 az login --use-device-code 的工作原理:

enter image description here

在给定网址中输入代码:

enter image description here

现在在 powershell 中您将得到这种类型的输出:

enter image description here

关于azure - 无需手动交互即可登录 Az,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72868911/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com