gpt4 book ai didi

powershell - 添加-AzureAccount : user_realm_discovery_failed: User realm discovery failed: Unable to connect to the remote

转载 作者:行者123 更新时间:2023-12-02 22:32:04 26 4
gpt4 key购买 nike

我有一个英雄 PowerShell 脚本,它尝试连接到 Azure:

$username = "asdfasdf"
$password = "asdfasdf"
$secstr = New-Object -TypeName System.Security.SecureString
$password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
Add-AzureAccount -Credential $cred
Select-AzureSubscription -SubscriptionId asdfasdf

但我收到此错误:

Add-AzureAccount : user_realm_discovery_failed: User realm discovery failed: Unable to connect to the remote 
server
At line:6 char:1
+ Add-AzureAccount -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureAccount], AadAuthenticationFailedException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount

我的用户绝对是 Azure 目录的共同管理员。我是否必须使用代理才能与 Azure 通信?

最佳答案

嗯,由于多种原因,这似乎是一个常见错误。尝试连接到服务结构时,我的用户名格式错误并收到错误:

user_realm_discovery_failed: User realm discovery failed

somedomain\fred应该是<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ff9edfafbdfecf0f2fafbf0f2fef6f1b1fcf0f2" rel="noreferrer noopener nofollow">[email protected]</a> .

一旦我纠正它,它就工作得很好。因此,鉴于上述答案,此错误似乎是由于连接或身份验证问题而出现的。

关于powershell - 添加-AzureAccount : user_realm_discovery_failed: User realm discovery failed: Unable to connect to the remote,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41572583/

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