Forum Discussion

Robert K's avatar
Robert K
Brass Contributor
Jul 05, 2022
Solved

How to get rid of warning 'Unable to acquire token for tenant 76a47f06...' with Connect-AzAccount?

How do I get rid of the warning 'WARNING: Unable to acquire token for tenant 76a47f06...' permanently and forever when I log in with 'Connect-AzAccount'?   I have already deleted the file "C:\Users...
  • LainRobertson's avatar
    Jul 06, 2022

    Robert K 

     

    Hi, Robert.

     

    All I can offer is some guesswork here since I can't reproduce this issue.

     

    With respect to the Clear-AzContext commandlet, make sure you set -Scope to CurrentUser. For example:

     

    Clear-AzContext -Scope CurrentUser -Force;
    Disconnect-AzAccount;

     

     

    Be sure to close the PowerShell session and open a new one after doing this. The following are also useful commandlets for checking current settings:

     

    • Get-AzContext -ListAvailable
    • Get-AzContextAutosaveSetting -Scope CurrentUser

     

    Also ensure you're on the latest version. You can read more about some of the version-specific issues below (somewhat dated now but possibly still relevant) - this warning being one of them - that manifested when Microsoft cut over from using the ADAL endpoint to the newer MSAL endpoint.

     

     

    Cheers,

    Lain

Resources