WindowsmacOSLinux

Where Does Azure CLI Store Config and Tokens?

Azure CLI ~/.azure folder with config, azureProfile.json and MSAL token cache on every OS.

Last updated

Azure CLI keeps config, subscription profiles (azureProfile.json) and MSAL token caches in an .azure folder in your home folder on every OS.

az account commands manage logins against these files. Clearing the folder signs everything out, which is the standard fix for stale subscription lists.

Where Azure CLI stores this, by platform

Windows
%USERPROFILE%\.azure

config plus azureProfile.json and msal_token_cache files. AZURE_CONFIG_DIR relocates the whole folder.

macOS
~/.azure

Same layout. Cloud shell sessions use their own copy, so local files do not affect browser shell.

Linux
~/.azure

Same layout. Service principal secrets in files here deserve owner only permissions.

Frequently asked questions

Azure CLI shows old subscriptions. How do I reset?

Clear the account data and log in fresh. The profile JSON rebuilds from the tenant on next login.

Where are Azure CLI access tokens cached?

In msal_token_cache files under .azure. They expire quickly; the CLI refreshes them silently while logged in.

Notice an outdated path? Let us know.