Menu

1 / 5

Adding an Environment to a GitHub Actions Job Changes the OIDC Subject and Breaks Azure Federated Login

DEV Community: azure·KBY Technologies·1 day ago
#mcLc00m7
#devtoazure#devto#dev#credential#environment
Reading 0:00
15s threshold

Originally published on KBY Technologies .

When a GitHub Actions job references an environment, GitHub changes the subject ( sub ) claim in the job’s OIDC token. A job without an environment, triggered by a push, sends repo:ORG/REPO:ref:refs/heads/BRANCH . Add environment: production to the same job and it sends repo:ORG/REPO:environment:production instead, on every branch. Microsoft Entra ID only exchanges the token when its issuer and subject exactly match a federated identity credential on the app registration or user-assigned managed identity, so a credential written for the branch stops matching and the azure/login step fails. The fix is to add a second credential with the exact environment subject, let it propagate, and only then merge the workflow change.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.