How to refresh user in MSAL cache

aot 66 Reputation points
2025-04-08T05:47:11.0666667+00:00

I recently updated my Active Directory password. Since then, I have been unable to run my Azure Machine Learning pipelines from VS Code. When running my code in the Azure CLI (pipeline using Azure ML SDK version: 1.53.0), an interactive authentication session is being launched, and I authenticate (successfully) through the pop up window in the browser. After doing so, the pipeline crashes with the message user ******@xxxx.com does not exist in MSAL token cache, run 'az login' .

This is despite me running an az login beforehand, or running it afterwards and try again. What has been attempted so far:

  • Running a normal az login prior to running my pipeline
  • Running az login --use-device-code before running pipeline
  • Running an az account clear before a login
  • Running az login while explicitly providing the desired subscription
  • Setting the desired subscription to the default subscription before logging in.
  • Logging in and out of Azure through the Azure portal
  • Logging in and out of my MS account through edge.
  • Restarting all programs (and PC) multiple times
  • Signing in to Windows with new password, rather than PIN
  • Manually removing the msal.cache file and repeating the above.

How do I refresh the MSAL token cache, so my Azure ML pipelines recognises the authentication? I have not had this issue before.

Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

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.