{"action":"opened","issue":{"url":"https://api.github.com/repos/Azure/azure-powershell/issues/1278","labels_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1278/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1278/comments","events_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1278/events","html_url":"https://github.com/Azure/azure-powershell/issues/1278","id":116418107,"number":1278,"title":"Error using Add-Azure Account with SPN Credentials","user":{"login":"davidmginn","id":831166,"avatar_url":"https://avatars.githubusercontent.com/u/831166?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmginn","html_url":"https://github.com/davidmginn","followers_url":"https://api.github.com/users/davidmginn/followers","following_url":"https://api.github.com/users/davidmginn/following{/other_user}","gists_url":"https://api.github.com/users/davidmginn/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmginn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmginn/subscriptions","organizations_url":"https://api.github.com/users/davidmginn/orgs","repos_url":"https://api.github.com/users/davidmginn/repos","events_url":"https://api.github.com/users/davidmginn/events{/privacy}","received_events_url":"https://api.github.com/users/davidmginn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-11T20:49:07Z","updated_at":"2015-11-11T20:49:07Z","closed_at":null,"body":"When trying to use the below to add an Azure Account, I'm receiving an error\r\n\r\n$Password = \"XXXXXXXX\"\r\n$Clientid = \"00000000-0000-0000-0000-000000000000\"\r\n$TenantId = \"domain.onmicrosoft.com\"\r\n\r\n'$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force'\r\n$servicePrincipalCredentials = New-Object System.Management.Automation.PSCredential ($ClientId, $securePassword)\r\nAdd-AzureAccount -ServicePrincipal -Tenant $TenantId -Credential $servicePrincipalCredentials | Out-Null \r\n\r\nBelow is the error:\r\n\r\nAdd-AzureAccount : The given key was not present in the dictionary.\r\nAt line:1 char:1\r\n+ Add-AzureAccount -ServicePrincipal -Tenant $TenantId -Credential $ser ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : CloseError: (:) [Add-AzureAccount], KeyNotFoundException\r\n    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount"}}