Azure–Token Error when execute from Powershell

I was doing the following :

  • Connect to a Azure from a Computer A
  • Execute the connection from PowerShell and connecting to Azure
  • Everything was ok.

Then I went to another location.  Executing the same process by connecting to Azure through the PowerShell.  I had no issue when executing the Add-AzureAccount but when I check I tried to get the subscription, I had the error as below :


After some finding, it seemed the token in the second location has expired.  Therefore I did the following :

  • The User I login is Administrator, therefore I go to :

C:UsersAdministratorAppsDataRoamingWindows Azure Powershell

Note : Change only the value in the PINK, with whatever credential you use to login to the PC.

  • Delete all the content in the directory


  • Proceed back to PowerShell and Add-AzureAccount
  • Then execute the Get-Subscription will display with no issue.

keywords : failed to refresh token, no service namespace, the server returned an error (400), AadAuthenticationFailedExecption, Bad Request

This post first appeared on Systems Center - Virtualization. Read the original article.