Switch Tenants in Azure CLI
Suppose your Microsoft 365 account is configured with access to multiple Microsoft 365 tenants in Azure AD. Using the Azure Portal affords you the ability to easily switch between tenants from the user menu. Unfortunately it is not as easy from the Azure CLI.
Suppose your Microsoft 365 account is configured with access to multiple Microsoft 365 tenants in Azure AD. Using the Azure Portal affords you the ability to easily switch between tenants from the user menu.
Unfortunately it is not as easy from the Azure CLI.
To switch to t a different to tenant, you need two things:
- Log in via Azure CLI:
az login
- In a browser, log into the Azure Portal.
- Switch the the appropriate tenant.
- Go to Azure Active Directory > Properties.
The tenant ID can be found on the Properties page. - Switch to the tenant in Azure CLI:
az login --tenant <tenant id>
That's it.