How to fix the error "The access token is from the wrong issuer. It must match the tenant'.

Amit Thapa 0 Reputation points
2025-03-18T09:51:00.82+00:00

I recently moved my subscription from an existing tenant to a new tenant yesterday. It was all fine, it is under the new tenant now but I am still getting this error when I am trying to deploy something via az cli commands. It has been more than an hour almost 24 hrs at this point but I am still getting this error.

Can you please help me?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,909 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 20,196 Reputation points MVP
    2025-03-18T12:32:44.06+00:00

    Hi Amit Thapa

    It could be wrong tenant still connected. You can check with the following command

    az account show

    If the account is still showing incorrectly, login with

    az login

    You will be prompted with [Tenant and subscription selection] prompt. Select the new subscription and tenant to connect to the correct account

    Hope this helps.


    --please don't forget to upvote and Accept as answer if the reply is helpful--

    0 comments No comments

  2. Ian Xue-MSFT 41,691 Reputation points Microsoft External Staff
    2025-03-19T06:54:53.3033333+00:00

    Hi,

    Please try clearing the cached tokens that might be causing the issue. You can do this by running the following command:

    az account clear
    

    Then sign in again to see if the issue persists.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.