Skip to content

Az CLI Login using service principal #1

Az CLI Login using service principal

Az CLI Login using service principal #1

# https://learn.microsoft.com/ja-jp/azure/developer/github/connect-from-azure
# https://github.com/Azure/actions-workflow-samples/blob/master/assets/create-secrets-for-GitHub-workflows.md
name: Az CLI Login using service principal
on:
workflow_dispatch:
jobs:
az-login-using-sp:
runs-on: ubuntu-latest
environment: Production
steps:
# https://github.com/fluffy-bunny/azure-login-action-act
- name: Install Azure CLI
if: github.actor == 'nektos/act'
shell: bash
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
- name: Azure Login
uses: Azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az account list-locations -o table
- name: Az CLI Logout
run: az logout