With the Azure login Action, you can automate your workflow to do an Azure login using Azure service principal and run Az CLI scripts.
Sample workflow that uses Azure login action using OIDC to run az cli
# File: .github/workflows/OIDC_login.yml
on: [push]
name: AzureLoginSample
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- run: |
az webapp list --query "[?state=='Running']"
License
GitHub Action for Azure Web App is licensed under the MIT License