Azure PowerShell: Your Azure credentials have not been set up or have expired (classic – ASM)

8:56 am in ASM, Azure, Azure PowerShell, PowerShell by Wim Matthyssen

Last week, after a long time I was cleaning up an Azure ASM environment with Azure PowerShell for a customer when I stumbled upon the following error:

“Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials.”


After checking the account settings, everything seemed valid. So probably for some reason, some old settings were cached causing the problem.



After trying and testing out some cmdlets, the following finally solved the issue:


When you have run the above cmdlet, try to run the Add-AzureAccount cmdlet and afterwards any other cmdlet to see if this also solves the issue for you.


Hope this helps you when you are facing the same issue.

Wim Matthyssen (@wmatthyssen)