Add-AzureAccount -credential doesn't work as I was hoping
4 days ago (Aug 4, 2014), a new version of Azure Powershell was released with a new -Credential parameter in the Add-AzureAccount cmdlet. I am trying to use it, but I am clearly doing something wrong. First, I save my password in a file:
read-host -assecurestring | convertfrom-securestring | out-file C:\temp\securestring.txt
Then try using 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
Failed to call Add-AzureAccount:
Add-AzureAccount: user_realm_discovery_failed: user detected failed: The remote server returned an error: (404) Not found.
I know that "dhdom1 \ jamiet" is the correct account. Does anyone know why this might fail? TIA
+3
source to share
2 answers