az-logout
Remove Azure CLI authentication credentials
TLDR
Logout current user
$ az logout
Logout specific user$ az logout --username [user@example.com]
SYNOPSIS
az logout [options]
DESCRIPTION
az logout logs out to remove access to Azure subscriptions. It clears access tokens and refresh tokens for the account from the local credential cache.The command is useful when switching between accounts or securing a shared system.
PARAMETERS
--username user
Account user to log out. If missing, log out the current active account.
WORKFLOW
$ # Logout current account
az logout
# Login with different account
az login
az logout
# Login with different account
az login
INSTALL
sudo dnf install azure-cli
sudo pacman -S azure-cli
sudo zypper install azure-cli
brew install azure-cli
nix profile install nixpkgs#azure-cli
CAVEATS
Does not revoke tokens on Azure side, only removes local cache. Service principal credentials in environment variables are not affected. Managed identity authentication persists.
HISTORY
az logout has been available since Azure CLI 2.0 in 2017 as the companion to az login for credential management.
SEE ALSO
az-login(1), az-account(1), az(1)
