The GitHub Action azlogin for Azure Login wraps the Azure PowerShell's Connect-AzAccount, allowing for Actions to log into Azure.
Because $HOME is persisted across Actions, the az login command will save this information on the filesystem, allowing other Actions to reuse the context.
The official action azure/login@v1 does not use $HOME.
- uses: segraef/azlogin@v1
with:
clientId: ${{ secrets.clientId }}
clientSecret: ${{ secrets.clientSecret }}
tenantId: <tenantId>
subscriptionId: <subscriptionId>
clientId– RequiredclientSecret– RequiredtenantId– RequiredsubscriptionId– Required
identity: yes/no– OptionalenvironmentName– Optional
You can create get the above details by running following command (details).
az ad sp create-for-rbac --name "<spName>" --role contributor --scopes /subscriptions/<subscriptionId> --sdk-auth