使用Microsoft Live帐户以非交互方式登录Azure [英] Login non-interactively to Azure using a Microsoft Live account

查看:56
本文介绍了使用Microsoft Live帐户以非交互方式登录Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图登录到azure而不提示从PowerShell弹出。我尝试了以下命令

I am trying to login to azure without prompting pop up from powershell. I tried the following command

$ username ="";
$
$ password ="";
$
$ securepasswd = ConvertTo-SecureString $ password -AsPlainText -Force;
$
$ cred = New-Object System.Management.Automation.PSCredential($ username,$ securepasswd) 

Connect-AzureRmAccount -Credential $ cred

$username = "";
$password = "";
$securepasswd = ConvertTo-SecureString $password -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ($username, $ securepasswd) 
Connect-AzureRmAccount -Credential $cred

这适用于非Microsoft帐户。但是在使用微软真实账户时。它抛出错误说"序列不包含任何元素"

This works fine for a non-microsoft account. But when using microsoft live account. It throws error saying "Sequence contains no elements"

如果有任何解决方案,请告诉我。提前致谢

Let me know if there are any solutions. Thanks in advance




推荐答案

Hi Sujatha,使用真实账户时会出现此错误,并在以下两个链接中提供相同的说明。

Hi Sujatha, This error is expected when using Live accounts and clarification for the same is provided in below two links.

https://stackoverflow.com/问题/ 45590948 / add-azurermaccount-sequence-contains-no-element-not-working-for-gmail-account

https://stackoverflow.com/questions/41608217/add-azurermaccount -sequence-contains-no-elements?rq = 1

希望这会有所帮助!!

Hope this helps!!


这篇关于使用Microsoft Live帐户以非交互方式登录Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆