Skip to content

Commit 06d7cda

Browse files
Merge pull request #730 from microsoft/psl-oidc
ci: Migrated GitHub Actions authentication from client secrets to OIDC and Integrated Smoke Testing Automation into the pipeline
2 parents c520b82 + 608b9aa commit 06d7cda

15 files changed

+125
-841
lines changed

.github/workflows/deploy-orchestrator.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
runner_os:
7-
description: 'Runner OS (ubuntu-latest, windows-latest, or devcontainer)'
7+
description: 'Runner OS (ubuntu-latest or windows-latest)'
88
required: true
99
type: string
1010
azure_location:
@@ -69,11 +69,7 @@ on:
6969

7070
env:
7171
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
72-
permissions:
73-
contents: read
74-
actions: read
75-
packages: write # Required by job-deploy → job-deploy-devcontainer to push devcontainer image to GHCR
76-
72+
7773
jobs:
7874
docker-build:
7975
uses: ./.github/workflows/job-docker-build.yml
@@ -104,8 +100,7 @@ jobs:
104100
secrets: inherit
105101

106102
e2e-test:
107-
# if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
108-
if: false # Temporarily disable E2E tests
103+
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
109104
needs: [docker-build, deploy]
110105
uses: ./.github/workflows/test-automation-v2.yml
111106
with:
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ on:
2727
type: choice
2828
options:
2929
- 'codespace'
30-
- 'Devcontainer'
3130
- 'Local'
3231
default: 'codespace'
3332

@@ -116,7 +115,8 @@ on:
116115
permissions:
117116
contents: read
118117
actions: read
119-
packages: write # Required by deploy-orchestrator → job-deploy → job-deploy-devcontainer for GHCR
118+
id-token: write # Required for OIDC-based Azure authentication
119+
packages: write # Required for GHCR operations
120120
jobs:
121121
validate-inputs:
122122
runs-on: ubuntu-latest
@@ -157,8 +157,8 @@ jobs:
157157
158158
# Validate runner_os (specific allowed values) and derive actual runner
159159
RUNNER_OS_INPUT="${INPUT_RUNNER_OS:-codespace}"
160-
if [[ "$RUNNER_OS_INPUT" != "codespace" && "$RUNNER_OS_INPUT" != "Devcontainer" && "$RUNNER_OS_INPUT" != "Local" ]]; then
161-
echo "❌ ERROR: runner_os must be one of: codespace, Devcontainer, Local, got: '$RUNNER_OS_INPUT'"
160+
if [[ "$RUNNER_OS_INPUT" != "codespace" && "$RUNNER_OS_INPUT" != "Local" ]]; then
161+
echo "❌ ERROR: runner_os must be one of: codespace, Local, got: '$RUNNER_OS_INPUT'"
162162
VALIDATION_FAILED=true
163163
else
164164
echo "✅ runner_os: '$RUNNER_OS_INPUT' is valid"
@@ -167,8 +167,6 @@ jobs:
167167
# Derive actual runner from runner_os input
168168
if [[ "$RUNNER_OS_INPUT" == "codespace" ]]; then
169169
RUNNER_OS="ubuntu-latest"
170-
elif [[ "$RUNNER_OS_INPUT" == "Devcontainer" ]]; then
171-
RUNNER_OS="devcontainer"
172170
else
173171
RUNNER_OS="windows-latest"
174172
fi

.github/workflows/deploy-windows.yml

Lines changed: 0 additions & 275 deletions
This file was deleted.

.github/workflows/docker-build.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ on:
3131
permissions:
3232
contents: read
3333
actions: read
34+
id-token: write # Required for OIDC-based Azure authentication
3435
jobs:
3536
build-and-push:
3637
runs-on: ubuntu-latest
38+
environment: production
3739

3840
steps:
3941
- name: Checkout repository
@@ -42,13 +44,18 @@ jobs:
4244
- name: Set up Docker Buildx
4345
uses: docker/setup-buildx-action@v3
4446

45-
- name: Log in to Azure Container Registry
47+
- name: Login to Azure (OIDC)
4648
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo')) || (github.event_name == 'workflow_dispatch' && (github.ref_name == 'dependabotchanges'||github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo')) }}
47-
uses: azure/docker-login@v2
49+
uses: azure/login@v2
4850
with:
49-
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
50-
username: ${{ secrets.ACR_USERNAME }}
51-
password: ${{ secrets.ACR_PASSWORD }}
51+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
52+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
53+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
54+
55+
- name: Log in to Azure Container Registry
56+
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo')) || (github.event_name == 'workflow_dispatch' && (github.ref_name == 'dependabotchanges'||github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo')) }}
57+
shell: bash
58+
run: az acr login --name ${{ secrets.ACR_LOGIN_SERVER }}
5259

5360
- name: Get current date
5461
id: date

0 commit comments

Comments
 (0)