gpt4 book ai didi

azure - 如何在 PowerShell 中使用 AzModule 命令创建 AzureProfile.json 文件?

转载 作者:行者123 更新时间:2023-12-03 01:26:20 27 4
gpt4 key购买 nike

我想使用 PowerShell 中的 Az Module 命令创建 AzureProfile.json 文件,以便我可以在任何想要登录 Azure 来启动/停止 VM 时导入 json 文件。

下面是我用来创建它的命令\脚本,但它给了我错误,如屏幕截图所示。

enter image description here

我也尝试使用下面的代码,但它给出了相同的错误。

Connect-AzAccount -UseDeviceAuthentication

Save-AzProfile -path "$PSScriptRoot\AzureProfile.json"

WARNING: Unable to acquire token for tenant 'organizations'Connect-AzAccount : DeviceCodeCredential authentication failed: Retryfailed after 4 tries.

最佳答案

从错误消息来看,Login-AzAccount 之后出现的浏览器弹出窗口中您的帐户身份验证似乎失败。

我运行了第一组命令并且运行成功。

Powershell:

enter image description here

创建的文件:

enter image description here

请注意,我的 PowerShell 版本5.7.0.18831

关于azure - 如何在 PowerShell 中使用 AzModule 命令创建 AzureProfile.json 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65788158/

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