Skip to content

Clean-up Azure Management Groups #15

Clean-up Azure Management Groups

Clean-up Azure Management Groups #15

# .github/workflows/azure-management-group-cleanup.yml
name: Clean-up Azure Management Groups
on:
workflow_dispatch: # allows to run manually
permissions:
id-token: write
contents: read
jobs:
azure-management-group-cleanup:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Azure Login without subscription
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
allow-no-subscriptions: true
enable-AzPSSession: true
- name: Execute script to remove management groups'
uses: azure/powershell@v1
with:
inlineScript: ./Remove-AzManagementGroups.ps1 -TenantId ${{ secrets.AZURE_TENANT_ID }}
azPSVersion: latest