Skip to content

Commit 123dad2

Browse files
committed
revert: switch to OIDC auth via azure/login@v2
Replace managed identity login with standard OIDC federated credentials using azure/login@v2 action. Add id-token:write permission and AZURE_TENANT_ID secret.
1 parent 2558bbc commit 123dad2

1 file changed

Lines changed: 9 additions & 28 deletions

File tree

.github/workflows/e2e-release-validation.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,16 @@ permissions:
5454
contents: read
5555
checks: write
5656
actions: read
57+
id-token: write
5758

5859
concurrency:
5960
group: e2e-validation-${{ github.ref }}
6061
cancel-in-progress: true
6162

6263
env:
63-
# Azure — runner authenticates via user-assigned managed identity
64+
# Azure — OIDC federated credentials
6465
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
66+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
6567
E2E_AZURE_SUBSCRIPTION_ID: ${{ secrets.E2E_AZURE_SUBSCRIPTION_ID }}
6668
E2E_KEY_VAULT_NAME: ${{ secrets.E2E_KEY_VAULT_NAME }}
6769
E2E_AZURE_RESOURCE_GROUP: "rg-sap-qa-e2e-${{ github.run_id }}"
@@ -121,33 +123,12 @@ jobs:
121123
fi
122124
az version --output table
123125
124-
- name: Azure Login (Managed Identity)
125-
run: |
126-
set -euo pipefail
127-
128-
# Capture values, then REMOVE AZURE_CLIENT_ID from env.
129-
# az CLI / azure-identity SDK inspects this env var and tries
130-
# EnvironmentCredential (service-principal) before ManagedIdentity,
131-
# which sends wrong query params to IMDS → "Invalid query variables".
132-
CLIENT_ID="$AZURE_CLIENT_ID"
133-
SUB_ID="$E2E_AZURE_SUBSCRIPTION_ID"
134-
unset AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID
135-
136-
# Verify IMDS is reachable
137-
echo "Checking IMDS reachability..."
138-
curl -sS -o /dev/null -w "IMDS HTTP %{http_code}\n" \
139-
-H "Metadata:true" \
140-
"http://169.254.169.254/metadata/instance?api-version=2021-02-01" \
141-
--connect-timeout 5 || {
142-
echo "::error::IMDS endpoint unreachable — not running on Azure VM?"
143-
exit 1
144-
}
145-
146-
echo "Authenticating via user-assigned managed identity..."
147-
az login --identity --client-id "$CLIENT_ID" --output none
148-
az account set --subscription "$SUB_ID"
149-
echo "Logged in. Active subscription:"
150-
az account show --query '{name:name, id:id}' -o table
126+
- name: Azure Login (OIDC)
127+
uses: azure/login@v2
128+
with:
129+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
130+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
131+
subscription-id: ${{ secrets.E2E_AZURE_SUBSCRIPTION_ID }}
151132

152133
- name: Load secrets from Key Vault
153134
run: |

0 commit comments

Comments
 (0)