Skip to content

Test Azure login workflow #9

Test Azure login workflow

Test Azure login workflow #9

Workflow file for this run

name: Test Azure login workflow
on:
workflow_dispatch:
inputs:
deployer:
description: "Deployer configuration name, use the following syntax: ENV-LOCA-VNET-INFRASTRUCTURE"
required: true
type: environment
permissions:
contents: write
id-token: write
issues: write
jobs:
test_spn_login:
name: Test SPN Azure Login
environment: ${{ inputs.deployer }}
runs-on: self-hosted
container:
image: ghcr.io/xpiritbv/azure-sap-automation:github-workflow
steps:
- name: Test SPN Az Login
run: |
az login --output none --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID
az account show
az logout
env:
AZURE_CLIENT_ID: ef6134f6-3912-41f7-b684-63fe90ae4100 # = SDAF-GH-Integration ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
- name: Azure Login SPN
uses: Azure/Login@v2
with:
creds: '{"clientId":"ef6134f6-3912-41f7-b684-63fe90ae4100","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
- name: Test SPN Login
run: |
az account show
az logout
test_sami_login:
name: Test System-assigned Managed Identity Azure Login
environment: ${{ inputs.deployer }}
runs-on: self-hosted
container:
image: ghcr.io/xpiritbv/azure-sap-automation:github-workflow
steps:
- name: Test System-assigned Managed Identity Az Login
run: |
az login --output none --identity
az account show
az logout
- name: Azure login with System-assigned Managed Identity
uses: Azure/Login@v2
with:
auth-type: IDENTITY
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Test System-assigned Managed Identity Login
run: |
az account show
az logout
test_uami_login:
name: Test User-assigned Managed Identity Azure Login
environment: ${{ inputs.deployer }}
runs-on: self-hosted
container:
image: ghcr.io/xpiritbv/azure-sap-automation:github-workflow
steps:
- name: Test User-assigned Managed Identity Az Login
run: |
az login --output none --identity --username 3de250ca-210c-4177-8f81-c07f7153be9b
az account show
az logout
- name: Azure login with User-assigned Managed Identity
uses: Azure/Login@v2
with:
auth-type: IDENTITY
client-id: 3de250ca-210c-4177-8f81-c07f7153be9b # = DVD-WEEU-DVD05-msi
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Test User-assigned Managed Identity Login
run: |
az account show
az logout