我能够使用弹出窗口登录Login-AzureRmAccount。我需要在VSTS CI主机中使用非交互模式。当我尝试在计算机上执行以下操作时:
$username = "my org login"
$pass = ConvertTo-SecureString "Mypass" -AsPlainText -Force
$cred = New-Object PSCredential($username,$pass)
Login-AzureRmAccount -Credential $cred
我收到消息:
Login-AzureRmAccount : accessing_ws_metadata_exchange_failed: Accessing WS
metadata exchange failed: The underlying con
nection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Login-AzureRmAccount -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Connect-AzureRmAccount],
AadAuthenticationFailedException
+ FullyQualifiedErrorId :
Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
我没主意了。
答案 0 :(得分:1)
您不能对启用了MFA的帐户使用静默身份验证。您必须走其他路线。