az login error: Authentication failed against tenant * ‘Default Directory’: (pii)

So It happened today that I got the error below while running “az login” command in Windows Terminal.

Authentication failed against tenant <-guid-> ‘Default Directory’: (pii). Status: Response_Status.Status_InteractionRequired, Error code: 3399614476, Tag: 557973645

The az login command was ran everytime, I was prompted to select an account I had logged in previously but then the error was showing up in the Terminal.

After a little googling I tried the following commands with no success:

❌ (didn't work)

az config set core.encrypt_token_cache=false
az account clear
az config set core.encrypt_token_cache=true

More Googling. Found the following reference:
https://learn.microsoft.com/en-us/answers/questions/1296678/az-login-error-failed-to-authenticate-my-guid-defa


Ran the following command and it worked:

✅✔️ worked!

az account --use-device-code

If you have MFA enabled then the Windows credentials manager may fail to provide the right level of authentication to the terminal. Use ‘az login --use-device-code‘ instead.

Leave a Comment