You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blogs/series-5-devops-data/5.5-azure-oidc-github-actions.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,12 +110,12 @@ RESOURCE_GROUP="rg-talent-dev" # Resource group to manage
110
110
LOCATION="eastus"# Azure region
111
111
GITHUB_ORG="workcontrolgit"# Your GitHub username or org
112
112
GITHUB_REPO="AngularNetTutorial"# Your repository name
113
-
BRANCH="main"# Branch that triggers deployments
113
+
BRANCH="master"# Branch that triggers deployments
114
114
```
115
115
116
116
**`APP_NAME`** — this is the display name of the App Registration in Azure Entra ID. It appears in the Azure Portal under "App registrations" and in audit logs. Use a name that makes the purpose clear.
117
117
118
-
**`BRANCH`** — the federated credential is scoped to this exact branch. Tokens from `develop`, pull request branches, or forks will not be trusted. For this tutorial, `main` is the deployment branch. Article 5.6 shows how to trigger on pushes to `main`.
118
+
**`BRANCH`** — the federated credential is scoped to this exact branch. Tokens from `develop`, pull request branches, or forks will not be trusted. For this tutorial, `master` is the deployment branch. Article 5.6 shows how to trigger on pushes to `master`.
119
119
120
120
### Step 2: Run the Script
121
121
@@ -153,17 +153,17 @@ The App Registration is the identity definition. The Service Principal is the in
This is the trust configuration. It tells Azure Entra ID:
164
164
165
165
***`issuer`** — tokens must be signed by GitHub's OIDC identity provider
166
-
***`subject`** — tokens must claim to be from exactly `repo:workcontrolgit/AngularNetTutorial:ref:refs/heads/main` — no other repo, no other branch
166
+
***`subject`** — tokens must claim to be from exactly `repo:workcontrolgit/AngularNetTutorial:ref:refs/heads/master` — no other repo, no other branch
167
167
***`audiences`** — the intended audience must be `api://AzureADTokenExchange` (Azure's OIDC exchange endpoint)
168
168
169
169
A token that matches all three conditions will be accepted. A token from a fork, a pull request branch, or a different repository is rejected by subject mismatch — even if it was legitimately signed by GitHub.
@@ -274,7 +274,7 @@ Find `github-actions-talent-dev`. Click it and navigate to:
274
274
Certificates & secrets → Federated credentials
275
275
```
276
276
277
-
You should see `github-actions-branch-main` with issuer `token.actions.githubusercontent.com`.
277
+
You should see `github-actions-branch-master` with issuer `token.actions.githubusercontent.com`.
278
278
279
279
To verify the role assignment:
280
280
@@ -294,7 +294,7 @@ The output should include a row with `Contributor` assigned to `github-actions-t
294
294
295
295
**Resource group scope, not subscription scope.** Granting `Contributor` at the subscription level would allow the deployment identity to create, modify, or delete any resource in the subscription — including the spending-limit configuration. Scoping to `rg-talent-dev` limits the blast radius: even a compromised token can only affect resources in that resource group.
296
296
297
-
**Branch-specific federated credential.** The `subject` claim in the federated credential locks trust to `refs/heads/main`. A pull request branch, a feature branch, or a fork cannot obtain an Azure access token using this credential. This prevents a malicious pull request from running arbitrary Azure CLI commands against the subscription.
297
+
**Branch-specific federated credential.** The `subject` claim in the federated credential locks trust to `refs/heads/master`. A pull request branch, a feature branch, or a fork cannot obtain an Azure access token using this credential. This prevents a malicious pull request from running arbitrary Azure CLI commands against the subscription.
298
298
299
299
**GitHub CLI (`gh`) for secret management.** Using `gh secret set` in the script eliminates manual copy-pasting. Manual steps introduce transcription errors and require the person running the script to have browser access to GitHub repository settings. The script runs end-to-end from the terminal with no manual steps except the SQL password.
0 commit comments