github-entra-federated-credentials
Skill2 starsChanged 8 months agoMITView on GitHub
Sets up Entra ID federated credentials so GitHub Actions can authenticate to Azure using OIDC (workload identity federation) — no client secrets required. USE THIS SKILL whenever the user wants to: connect GitHub Actions to Azure, configure Azure login from GitHub Actions, set up OIDC or workload identity federation between GitHub and Azure, avoid storing Azure credentials as GitHub secrets, configure Entra ID / Azure AD app registration for a GitHub repository, use azure/login@v2 in a workflow, or get a "AADSTS700213: No matching federated identity record" error. Invoke this skill even if the user just says "set up Azure access from GitHub", "let GitHub Actions deploy to Azure", or "configure my Actions to use Azure".
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- azure-paas-supportSkill
- azure-resource-abbreviationsSkill
- backlog-apiSkill
- csharp-file-based-appsSkill
- dependabot-auto-mergeSkill
- devblog-updatesSkill
- github-changelogSkill
- git-worktreeSkill
- hatena-blog-publisherSkill
- marp-cssSkill
- marp-deckSkill
- summarized-postSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Ask the user for any missing values before running the script:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
What this skill does
Automates the complete Entra ID federated credentials setup for a GitHub repository:
- Creates an Entra app registration and service principal
- Fetches the GitHub owner ID and repository ID (needed for the correct OIDC subject)
- Creates a federated credential with the right subject format
- Creates the GitHub Environment if it doesn't exist
- Registers
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_IDas secrets
Prerequisites
Before running, verify:
azCLI installed and logged in (az login)ghCLI installed and logged in (gh auth login)- User has permission to create app registrations in the Entra tenant
Inputs to collect
Ask the user for any missing values before running the script:
| Argument | Description | Example |
--app-name | Display name for the Entra app | my-github-actions-app |
--repo | GitHub repo in owner/repo format | myorg/myapp |
--environment | GitHub Environment name | Production |
--resource-group | Resource group for Contributor role assignment (optional) | rg-myapp |
Running the setup script
Collect all required inputs from the user first, then run the script for their environment.
Windows (PowerShell):
pwsh "<skill_dir>/scripts/setup.ps1" `
-AppName "<app name>" `
-Repo "<owner/repo>" `
-Environment "<env name>" `
[-ResourceGroup "<rg name>"]macOS / Linux (Bash):
bash "<skill_dir>/scripts/setup.sh" \
--app-name "<app name>" \
--repo "<owner/repo>" \
--environment "<env name>" \
[--resource-group "<rg name>"]<skill_dir> is the directory containing this SKILL.md file.
OIDC subject format — why IDs matter
GitHub's OIDC tokens use a subject in this format:
repo:{owner}@{owner_id}/{repo}@{repo_id}:environment:{env}This is not the same as repo:{owner}/{repo}:environment:{env}. The numeric owner and
repository IDs must be included. The script fetches them automatically via gh api.
Registering the wrong subject causes AADSTS700213 errors at runtime.
After setup
The workflow template printed by the script is ready to use. The three secrets
(AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID) are scoped to the
specified GitHub Environment, so the workflow must declare environment: <env name>.
Troubleshooting
| Error | Likely cause | Fix |
AADSTS700213 | Subject mismatch in federated credential | Re-run setup; check owner/repo IDs |
gh secret set fails | Environment doesn't exist | Script creates it via gh api PUT first |
az ad app federated-credential create fails | Inline JSON quoting issue | Script uses a temp file — should not occur |
| Role assignment fails | Insufficient permissions | Assign manually or use a privileged account |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

