附加AzureAccount -credential不工作,我会希望 [英] Add-AzureAccount -credential not working as I'd hoped
问题描述
3天前(2014年8月4日)出现了,其中包括一个新的 -Credential 上的Add-AzureAccount cmdlet的参数的Azure Powershell的新版本。我试图使用它,但我清楚地做错事。
首先,我储存我的密码在一个文件中:
4 days ago (on 4th August 2014) there was a new release of Azure Powershell that included a new -Credential parameter on the Add-AzureAccount cmdlet. I'm trying to use it but I'm clearly doing something wrong. First I store my password in a file:
read-host -assecurestring | convertfrom-securestring | out-file C:\temp\securestring.txt
然后尝试,并在附加AzureAccount
Then try and use it in Add-AzureAccount
$password = cat C:\temp\securestring.txt | convertto-securestring
$username = "dhdom1\jamiet" #yes, this is the correct username
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$password
Add-AzureAccount -credential $mycred
呼叫添加-AzureAccount失败:
The call to Add-AzureAccount fails:
添加-AzureAccount:user_realm_discovery_failed:用户领域发现
失败:远程服务器返回错误:(404)未找到
Add-AzureAccount : user_realm_discovery_failed: User realm discovery failed: The remote server returned an error: (404) Not Found.
我知道dhdom1 \\ jamiet是正确的帐户。任何人任何想法,为什么这可能会失败? TIA
I know that "dhdom1\jamiet" is the correct account. Anyone any idea why this might be failing? TIA
推荐答案
您应该使用单位帐户用于登录到Azure的门户用。因此,它可能看起来像jamiet@yourorganizationalaccountname.com,或者类似的东西。
You should use the organizational account you use to log in to the Azure Portal with. So, it might look like jamiet@yourorganizationalaccountname.com, or something like that.
这篇关于附加AzureAccount -credential不工作,我会希望的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!