Azure – Unable to acquire token for tenant

CAzContext_04

In today’s post I will show a recurring problem that can happen when connecting to Azure through PowerShell when we already have a login history from other Azure’s tenants.

As soon as we try to log into Azure via PowerShell, we will get this error stating that an existing token from another subscription could not be acquired (Your access to that subscription may have been removed and the context is still present in the local files).

CAzContext_01

To clear the historic sessions context in PowerShell we have to execute the command “Clear-AzContext”

CAzContext_02

After running this command above, you can log in again and check that the error has been fixed and the history has been removed.

CAzContext_03

And that’s it folks, quick and practical post.
See you soon!

Joao Costa

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s