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.”

clip_image002

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

clip_image004

Solution:

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

clip_image005

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.

clip_image007

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

Wim Matthyssen (@wmatthyssen)