azure/login@v3
Authenticate to Azure and run your Azure CLI or Azure PowerShell based actions or scripts.
At a glance
- Latest major
v3- Repository
- azure/login
- Inputs
- 11 (0 required)
- Outputs
- 0
- Runs using
node24- License
- MIT
- Last checked
Inputs and outputs come straight from the action's official action.yml. See our editorial standards.
Usage
- uses: azure/login@v3Inputs
| Name | Required | Default | Description |
|---|---|---|---|
creds | No | none | Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS |
client-id | No | none | ClientId of the Azure Service principal created. |
tenant-id | No | none | TenantId of the Azure Service principal created. |
subscription-id | No | none | Azure subscriptionId |
enable-AzPSSession | No | false | Set this value to true to enable Azure PowerShell Login in addition to Azure CLI login |
environment | No | azurecloud | Name of the environment. Supported values are azurecloud, azurestack, azureusgovernment, azurechinacloud, azuregermancloud. Default being azurecloud |
allow-no-subscriptions | No | false | Set this value to true to enable support for accessing tenants without subscriptions |
audience | No | api://AzureADTokenExchange | Provide audience field for access-token. Default value is api://AzureADTokenExchange |
auth-type | No | SERVICE_PRINCIPAL | The type of authentication. Supported values are SERVICE_PRINCIPAL, IDENTITY. Default value is SERVICE_PRINCIPAL |
max-context-population | No | none | Only used when enable-AzPSSession is true. Overrides the Azure PowerShell MaxContextPopulation used by Connect-AzAccount (the number of subscription contexts loaded). Set to -1 to load all subscriptions, or a positive integer. When unset, the Azure PowerShell default of 25 applies. |
mask-client-id | No | true | Set this value to false to stop registering the client-id as a secret, so it is not masked in workflow logs |
Outputs
This action declares no outputs in its action.yml.
Examples
Sign in with federated credentials
OIDC login with an app registration; no client secret is stored.
name: Example
on:
push:
branches: [main]
permissions:
id-token: write
contents: read
jobs:
example:
runs-on: ubuntu-latest
steps:
- name: Azure Login
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- run: az account showEach example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.
Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.