Credential complaint for Azure credentials

Credential complaint for Azure credentials

Q. I am using Add-AzureAccount however it complains my credentials have expired even after running Remove-AzureAccount.

A. The solution seems to remove ALL accounts from your environment then try adding Add-AzureAccount again. The easiest solution is to run the PowerShell below which will remove all accounts from your machine and after this the Add-AzureAccount should work fine.

foreach ($AzureAccount in (Get-AzureAccount).ID) {Remove-AzureAccount $AzureAccount -Force}

Note that after running you will need to set the default subscription again, e.g.

Select-AzureSubscription -SubscriptionId <ID>


Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.