Forrest logo
back to the az tool

az-login:tldr:c9233

az-login: 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-com}
try on your machine

This command is used to log in to Azure using a service principal (a non-human identity used for automation and application authentication). Here's an explanation of each part of the command:

  • az login: This is the Azure CLI command used to initiate the login process.
  • --service-principal: This option specifies that you want to log in using a service principal.
  • --username ${http:--azure-cli-service-principal}: Here, ${http:--azure-cli-service-principal} is a placeholder for the URL of the service principal. It indicates that you need to replace it with the actual URL.
  • --password ${secret}: ${secret} is another placeholder that must be replaced with the actual password or authentication secret associated with the service principal.
  • --tenant ${someone-onmicrosoft-com}: Similarly, ${someone-onmicrosoft-com} is a placeholder for the Azure Active Directory (AAD) tenant ID or a custom domain associated with the Azure account. Replace it with the relevant value.

In summary, the command is authenticating and logging in to Azure using a service principal with the provided username, password, and tenant information.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the az tool