'az acr login results in error: can’t find token from MSAL cache

Installed podman on MacBook Pro m1. When I run:

Token=#(az acr login —name myname —expose-token —output tsv query access Token)

I get the following error:

ERROR: can’t find token from MSAL cache. 
To re-authetnicate, please run  az login

I logged in after running az login and authenticated, but still have the same error.



Solution 1:[1]

  • Try clearing the cache from the .azure folder from the home directory /var/root
  • Also clear the cache using MSAL.net

Clearing the cache is achieved by removing the accounts from the cache. This does not remove the session cookie which is in the browser, though.

  • Now re check the installation of Podman once again.

Solution 2:[2]

tl;dr?: check the system time.

I received the same error with Azure command line although I was logged in according to the web browser?:

Can't find token from MSAL cache.

To re-authenticate, please run:

az login

There was a traceback in the terminal from which I launched az login, with the following message?:

  1. The ID token is not yet valid. Current epoch = 1650445935.

Turned out the VM system time was wrong, and I could access my blobs after setting it correctly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SaiSakethGuduru-MT
Solution 2 Skippy le Grand Gourou