entra-agent-id-setup
Skill12 starsChanged 7 months agoMITView on GitHub
AI-guided setup for Microsoft Entra Agent ID. Use when the user wants to provision an Agent Identity Blueprint, Agent Identity, and OBO client app in an Entra tenant; when configuring the dev/AWS/GCP sidecar stack; when debugging 403 Authorization_RequestDenied on blueprint creation; when checking which Entra role is required (Global Admin / Agent ID Administrator / Agent ID Developer); when running Start-EntraAgentIDWorkflow / setup-obo-client-app / setup-obo-blueprint.
- Reads credentials
- Sends data out
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- n8n/.github/copilot-instructions.mdCopilot instructions
- deploy-agent-aca-awsSkill
- deploy-agent-aca-devSkill
- teardown-agent-aca-awsSkill
- teardown-agent-aca-devSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
MFA: If the signing-in user was just created, they MUST complete MFA enrollment via browser first (AADSTS50079).
- Distinctive: line 36
Run the end-to-end workflow.
- Very specific: line 52
Write $r.Blueprint.BlueprintAppId, $r.Blueprint.ClientSecret, and $r.Agent.AgentIdentityAppId into sidecar/dev/.env as BLUEPRINT_APP_ID, …
- Very specific: line 87
Verify: curl http://localhost:3003/api/status returns agent_app_id, ollama_available, sidecar_url.
≈ “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
Entra Agent ID Setup (AI-Guided)
End-to-end provisioning of a Microsoft Entra Agent Identity + OBO-capable client app, plus bringing up the sidecar stack.
When to Use
- User says: "set up agent ID", "create blueprint", "provision agent identity", "configure OBO", "set up the sidecar"
- User hits
403 Authorization_RequestDeniedwhen creating a blueprint - User asks what Entra role is needed for agent ID
- User wants to go from empty tenant → working autonomous + OBO flows
Prerequisites (verify BEFORE running scripts)
- Entra role assigned to the signing-in user. One of:
Global AdministratorAgent ID Administrator(templatedb506228-d27e-4b7d-95e5-295956d6615f)Agent ID Developer(templateadb2368d-a9be-41b5-8667-d96778e081b0)Application AdministratorandCloud Application Administratorare NOT sufficient — they cannot createagentIdentityBlueprints(verified: 403 onPOST /beta/applications/with@odata.type: Microsoft.Graph.AgentIdentityBlueprint). See references/permissions.md.
- Tenant features: Agent Identity APIs enabled.
AgentUserentity type is feature-gated per-tenant — not required for autonomous/OBO flows; removed from our scripts. See references/troubleshooting.md. - Tooling:
- Azure CLI (
az) signed in to the target tenant - PowerShell 7+ (
pwsh) Microsoft.Graph.AuthenticationandMicrosoft.Graph.Beta.ApplicationsPowerShell modules (install:Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.Beta.Applications -Scope CurrentUser)- Docker Desktop (only for local docker-compose in Step 4; not needed for ACA deployments — see
deploy-agent-aca-dev)
- Azure CLI (
- MFA: If the signing-in user was just created, they MUST complete MFA enrollment via browser first (
AADSTS50079). Password-onlyaz login -u -pwill fail.
Procedure
Step 1 — Create Blueprint + Agent Identity
Run the end-to-end workflow. Creates Blueprint app, Blueprint SP, client secret, Agent Identity, and assigns Graph permissions.
[!WARNING] Run
Connect-MgGraphin an interactive pwsh session, not viapwsh -Command "Connect-MgGraph ..."subshell. The WAM authentication popup hides behind other windows in a subshell and silently times out.
[!NOTE] The scope list below must match what
EntraAgentID-Functions.ps1validates internally (10 scopes). If you omit any, the script throwsMissing required Microsoft Graph scopes.
pwsh
. /path/to/repo/scripts/EntraAgentID-Functions.ps1
Connect-MgGraph -Scopes "AgentIdentityBlueprint.AddRemoveCreds.All","AgentIdentityBlueprint.Create","AgentIdentityBlueprint.DeleteRestore.All","AgentIdentity.DeleteRestore.All","DelegatedPermissionGrant.ReadWrite.All","Application.Read.All","AgentIdentityBlueprintPrincipal.Create","AppRoleAssignment.ReadWrite.All","Directory.Read.All","User.Read" -TenantId <tenant-id>
$r = Start-EntraAgentIDWorkflow -BlueprintName "Demo Blueprint" -AgentName "Weather Agent" -Permissions @("User.Read.All")Write $r.Blueprint.BlueprintAppId, $r.Blueprint.ClientSecret, and $r.Agent.AgentIdentityAppId into sidecar/dev/.env as BLUEPRINT_APP_ID, BLUEPRINT_CLIENT_SECRET, AGENT_CLIENT_ID, plus TENANT_ID.
Supporting script: EntraAgentID-Functions.ps1
Step 2 — Register OBO Client SPA
pwsh /path/to/repo/scripts/setup-obo-client-app.ps1Creates an Entra app with SPA redirect URI http://localhost:3003 and appends CLIENT_SPA_APP_ID=<id> to the detected .env.
Supporting script: setup-obo-client-app.ps1 (bash: setup-obo-client-app.sh)
Step 3 — Configure Blueprint for OBO
pwsh /path/to/repo/scripts/setup-obo-blueprint.ps1 `
-BlueprintAppId <blueprint-id> `
-AgentAppId <agent-id> `
-ClientSpaAppId <spa-id> `
-TenantId <tenant-id>This sets api://<blueprint> as App ID URI, adds the access_as_user delegated scope, adds API permission on the Client SPA, and grants admin consent for both Agent→Graph (User.Read) and Client SPA→Blueprint (access_as_user).
Supporting script: setup-obo-blueprint.ps1 (bash: setup-obo-blueprint.sh)
Step 4 — Bring Up Sidecar Stack
cd sidecar/dev
docker compose --env-file .env up --build -dVerify: curl http://localhost:3003/api/status returns agent_app_id, ollama_available, sidecar_url.
Step 5 — Test Flows
- Autonomous Direct:
curl -s -X POST http://localhost:3003/api/chat -H 'Content-Type: application/json' -d '{"message":"weather in seattle","use_langchain":false,"token_flow":"autonomous"}'→ should return Seattle weather; TR tokenroles: [User.Read.All]. - OBO: open
http://localhost:3003in a browser, sign in with MSAL popup, chat withtoken_flow: obo.
Key Artifacts (for reuse)
Persist these in sidecar/<target>/.env:
TENANT_IDBLUEPRINT_APP_IDBLUEPRINT_CLIENT_SECRETAGENT_CLIENT_IDCLIENT_SPA_APP_ID
References
- Required permissions and role comparison
- Troubleshooting matrix
- Graph API call sequence
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.

