我有一個英雄PowerShell腳本試圖Azure中的連接:添加-AzureAccount:user_realm_discovery_failed:用戶領域發現失敗:無法連接到遠程
$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進行通信嗎?
您可以在Portal上登錄您的Azure帳戶嗎? –
是的,我可以用這種方式登錄。 – santafebound