0

The two lines of code worked perfectly in one of my Azure-Powershell-Workflow runbook until recently.

$azureCredential = Get-AutomationPSCredential –Name "<asset-name>"
Add-AzureAccount -credential $azureCredential

Now it fails with the error-message Add-AzureAccount : The given key was not present in the dictionary. The inspection of the $azureCredential did not bring up anything suspicious.

Q What must I do to get it going again?

juvchan
  • 6,113
  • 2
  • 22
  • 35
participant
  • 2,923
  • 2
  • 23
  • 40

1 Answers1

1

This error can happen in Add-AzureAccount if the credential doesn't have access to any RDFE (Azure Service Management) subscriptions. You can follow the directions here to add the credential to an RDFE subscription.

Joe
  • 2,500
  • 1
  • 14
  • 12
  • How did you reassign the subscription to the user, so i can update my answer? – Joe Apr 05 '16 at 18:03
  • Sorry, my comment before was incorrect, therefore I deleted it. I removed and afterwards added the user and reassigned the co-admin role. Then it worked again. – participant Apr 06 '16 at 11:29