Skip to content

Commit ec16223

Browse files
committed
docs(golden-paths): document per-repo OIDC federated credential bootstrap for IaC
1 parent c1db3a0 commit ec16223

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

golden-paths/h2-enhancement/todo-app-e2e/skeleton/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,19 @@ Azure secrets are inherited from the `3horizons` organization:
4545
- `AZURE_TENANT_ID` — Microsoft Entra tenant
4646
- `AZURE_SUBSCRIPTION_ID` — Target Azure subscription
4747

48-
No manual secret configuration is needed. The OIDC federated credential is configured for all repos in the org using environment `dev`.
48+
No manual secret configuration is needed for these three secrets.
49+
50+
For OIDC login to Azure, each new repository needs a one-time federated credential in app `three-horizons-github-oidc` with subject:
51+
52+
`repo:${{ values.repoOwner }}/${{ values.repoName }}:environment:dev`
53+
54+
Example (run by tenant/app admin):
55+
56+
```bash
57+
az ad app federated-credential create \
58+
--id <APP_OBJECT_ID> \
59+
--parameters "{\"name\":\"github-${{ values.repoName }}-dev\",\"issuer\":\"https://token.actions.githubusercontent.com\",\"subject\":\"repo:${{ values.repoOwner }}/${{ values.repoName }}:environment:dev\",\"audiences\":[\"api://AzureADTokenExchange\"]}"
60+
```
4961

5062
Optional variable:
5163

golden-paths/h2-enhancement/todo-app-e2e/template.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,16 @@ spec:
169169
**Azure region:** ${{ parameters.azureRegion }}
170170
171171
**Azure IaC is ready to use:**
172-
- Azure OIDC pre-configured (App Registration: `three-horizons-github-oidc`)
173172
- Organization secrets `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_SUBSCRIPTION_ID` inherited automatically
174173
- Environment `dev` created in the repository
175174
- Run workflow `iac-dev.yml` with `apply=true` to provision Azure resources
176175
176+
**One-time OIDC bootstrap (required per new repo):**
177+
create a federated credential with subject `repo:<owner>/<repo>:environment:dev` in app `three-horizons-github-oidc`.
178+
179+
Example:
180+
`az ad app federated-credential create --id <APP_OBJECT_ID> --parameters '{"name":"github-${{ parameters.repoUrl | parseRepoUrl | pick('repo') }}-dev","issuer":"https://token.actions.githubusercontent.com","subject":"repo:${{ parameters.repoUrl | parseRepoUrl | pick('owner') }}/${{ parameters.repoUrl | parseRepoUrl | pick('repo') }}:environment:dev","audiences":["api://AzureADTokenExchange"]}'`
181+
177182
**Identity note:** ensure the selected owner (`User` or `Group`) exists in the Software Catalog.
178183
179184
**Codespaces:** use the "Open in Codespaces" link above to launch the dev environment for the created repository.

0 commit comments

Comments
 (0)