Azure OIDC login via self-hosted runner #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Azure Login Test | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| test-oidc: | |
| runs-on: [self-hosted, macOS, ARM64, M1Max] # juster til dine labels (terminal / Web GUI) | |
| environment: dev # må matche environment i Azure Federated Credential | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Azure login with OIDC | |
| uses: azure/login@v2 | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID }} # eller env som vist tidligere | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| enable-AzPSSession: false | |
| - name: Verify context | |
| run: | | |
| az account show |