WARNING: Unable to acquire token for tenant
I was trying to log into my Azure subscription when I encountered the following error. It isn’t the first time but the reason was slightly different from the previous.
This time it was saying WARNING: Unable to acquire token for tenant ‘organizations’ with error ‘InteractiveBrowserCredential authentication failed: The browser based authentication dialog failed to complete. Reason: The server or proxy was not found.’
I tried applying the same step for the previous error and it went through.
You can follow these steps if to get it fixed.
- Close all the PowerShell session
- Open Windows Explorer and go to the folder under C:\Users\<Your User Name\.Azure
- Look for the file “AzureRmContext.json” and delete it. You can create a backup copy first if you need to.
- Now try to open PowerShell again and Connect to you Azure account using Login-AzAccount -UseDeviceAuthentication . You will see the URL that says https://microsoft.com/devicelogin with the login code
- Fire up a browser with the URL and log in with your credentials that has access to the Azure subscription and then key in the code. That should work!