CmdID

CmdID / Commands

az-login

Log in to Azure. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Log in to Azure. Part of azure-cli (also known as az).

Log in interactively

az loginIdentify

Log in with a service principal using a client secret

az login --service-principal --username http://azure-cli-service-principal --password secret --tenant someone.onmicrosoft.comIdentify
--service-principalLog in with a service principal. Azure CLI reference
--usernameUser name or service principal client ID. Azure CLI reference
--passwordUser password or service principal secret. Azure CLI reference
--tenantThe Microsoft Entra tenant, must be provided when using a service principal. Azure CLI reference

Log in with a service principal using a client certificate

az login --service-principal --username http://azure-cli-service-principal --password path/to/cert.pem --tenant someone.onmicrosoft.comIdentify
--service-principalLog in with a service principal. Azure CLI reference
--usernameUser name or service principal client ID. Azure CLI reference
--passwordUser password or service principal secret. Azure CLI reference
--tenantThe Microsoft Entra tenant, must be provided when using a service principal. Azure CLI reference

Log in using a VM's system assigned identity

az login --identityIdentify
--identityLog in using managed identity Azure CLI reference

Log in using a VM's user assigned identity

az login --identity --username /subscriptions/subscription_id/resourcegroups/my_rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my_idIdentify
--identityLog in using managed identity Azure CLI reference
--usernameUser name or service principal client ID. Azure CLI reference