Forum Discussion
How to get rid of warning 'Unable to acquire token for tenant 76a47f06...' with Connect-AzAccount?
- Jul 06, 2022
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
I had the same problem but found out what the issue was for me. I was opening my powershell as administrator, when I don't do that I was able to log on.
Update-AzConfig -EnableLoginByWam $false
and then:
Connect-AzAccount