Copilot cloud agent OIDC token no longer includes environment in subject claim, breaking Azure federated credential login (regression since ~May 5-9, 2026) #196070
Replies: 7 comments 9 replies
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hey @avrum, Thanks for the incredibly detailed report. I've looked into this and unfortunately, it seems you've hit a genuine bug. Based on your thorough analysis, the issue is clear. Since around May 5th, the Copilot cloud agent's dynamic workflow has stopped including the GitHub Actions Because Azure's federated identity credentials require an exact match on the For now, there is no workaround. However, here's the best path forward:
You've already opened a ticket with GitHub Support, which is the right move. The ball is now in their court to fix this regression. Thank you for being so persistent. |
Beta Was this translation helpful? Give feedback.
-
|
Anyone has similar issues? |
Beta Was this translation helpful? Give feedback.
-
|
If anyone else experience this issue, please upvote to get some trackion for this critical issue, |
Beta Was this translation helpful? Give feedback.
-
|
We are also experiencing this issue, confirmed. It was working for us before this date and suddenly stopped working. |
Beta Was this translation helpful? Give feedback.
-
|
Any one got any response? or a workarround? |
Beta Was this translation helpful? Give feedback.
-
|
Response from support
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Copilot in GitHub
Body
Copilot cloud agent OIDC token no longer includes
environmentin subject claim, breaking Azure federated credential login (regression ~May 2026)Summary
The Copilot cloud agent's dynamic workflow (
/dynamic/copilot-swe-agent/copilot@...) stopped including the GitHub Actionsenvironmentin the OIDC token'ssubclaim around early May 2026. This completely breaks Azure OIDC federated credential login for any setup using theenvironment:copilotsubject pattern, which is the officially documented and recommended configuration per:azd coding-agent configextension ([blog post](https://devblogs.microsoft.com/azure-sdk/azure-developer-cli-copilot-coding-agent-config/))The Problem
When
environment: copilotis set on thecopilot-setup-stepsjob, the OIDC token's subject claim should be:Instead, since approximately May 5-9, 2026, the dynamic workflow emits:
This causes Azure to reject the token with
AADSTS700213: No matching federated identity record found.Evidence: Before and After
Same workflow file, same repository, same Azure federated credential, same managed identity. Nothing changed on our side.
SUCCESSFUL run (early May 2026):
FAILED run (~4 days later):
Key differences:
Secret sourcechanged fromNonetoAgentSecretsenvironment:copilottoref:refs/heads/copilot/...Self-Service Fix Attempted: OIDC Subject Claim Customization
I tried to fix this using the repository-level OIDC Configuration page (Settings > Actions > OIDC):
repo, contextResult: The dynamic workflow completely ignored the custom template. The subject claim still showed
ref:refs/heads/copilot/.... Thecontextvariable should resolve to the environment name when the job specifiesenvironment: copilot(per [GitHub's OIDC docs](https://docs.github.com/en/actions/reference/security/oidc)), but the Copilot agent's dynamic workflow bypasses the repository-level OIDC subject claim customization entirely.Our Configuration (matches all official docs)
copilot-setup-steps.yml:
Azure Federated Credential (User-Assigned Managed Identity):
This is exactly what Microsoft's
azd coding-agent configgenerates automatically.Three Things the Dynamic Workflow Ignores
environment: copiloton thecopilot-setup-stepsjob (for OIDC subject generation)contextresolves to the environment name per [GitHub's OIDC reference](https://docs.github.com/en/actions/reference/security/oidc)Why There Is No Azure-Side Workaround
claimsMatchingExpressionare only available on App Registrations, not managed identities ([Microsoft docs](https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-flexible-federated-identity-credentials))environment:copilotpattern IS the recommended solution for dynamic branch names, because it is branch-agnostic. That is specifically why Microsoft's tooling generates it.Impact
continue-on-error: trueon the Azure login step, which means the agent runs without Azure accessExpected Behavior
The OIDC token's
subclaim should berepo:<org>/<repo>:environment:copilotwhen thecopilot-setup-stepsjob specifiesenvironment: copilot, regardless of whichcopilot/*branch the dynamic workflow runs on. This was the correct behavior prior to early May 2026.Is Anyone Else Hitting This?
If you are using Copilot cloud agent with Azure OIDC login (via
azure/loginwith federated credentials on a managed identity), and your login started failing around early May 2026, you are likely hitting the same issue. Check your Action logs for whether thesubject claimshowsenvironment:copilotorref:refs/heads/copilot/....I have also filed a support ticket with GitHub for this issue.
Beta Was this translation helpful? Give feedback.
All reactions