2021-07-20 09:31:17 +01:00
|
|
|
# az login
|
|
|
|
|
|
|
|
> Log in to Azure.
|
2023-10-15 08:42:29 +01:00
|
|
|
> Part of `azure-cli` (also known as `az`).
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/cli/azure/reference-index#az_login>.
|
2021-07-20 09:31:17 +01:00
|
|
|
|
|
|
|
- Log in interactively:
|
|
|
|
|
|
|
|
`az login`
|
|
|
|
|
|
|
|
- Log in with a service principal using a client secret:
|
|
|
|
|
2023-05-10 12:25:34 +01:00
|
|
|
`az login --service-principal --username {{http://azure-cli-service-principal}} --password {{secret}} --tenant {{someone.onmicrosoft.com}}`
|
2021-07-20 09:31:17 +01:00
|
|
|
|
|
|
|
- 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.com}}`
|
|
|
|
|
|
|
|
- Log in using a VM's system assigned identity:
|
|
|
|
|
|
|
|
`az login --identity`
|
|
|
|
|
|
|
|
- Log in using a VM's user assigned identity:
|
|
|
|
|
|
|
|
`az login --identity --username /subscriptions/{{subscription_id}}/resourcegroups/{{my_rg}}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{{my_id}}`
|