[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FDB8C40QPRJ5E9Z4E0JC2K":3,"skill-same:01M6FDB8C40QPRJ5E9Z4E0JC2K":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6FDB8C40QPRJ5E9Z4E0JC2K","entra-agent-id",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fentra-agent-id\u002FSKILL.md",[],[18,19,20],"entra agent id","id","agent id","2026-11-10 10:12:30",false,"# Microsoft Entra Agent ID\n\nCreate and manage OAuth2-capable identities for AI agents using Microsoft Graph beta API.\n\n> **Preview API** — All Agent Identity endpoints are under `\u002Fbeta` only. Not available in `\u002Fv1.0`.\n\n## Before You Start\n\nSearch `microsoft-docs` MCP for the latest Agent ID documentation:\n- Query: \"Microsoft Entra agent identity setup\"\n- Verify: API parameters match current preview behavior\n\n## Conceptual Model\n\n```\nAgent Identity Blueprint (application)        ← one per agent type\u002Fproject\n  └── BlueprintPrincipal (service principal)   ← MUST be created explicitly\n        ├── Agent Identity (SP): agent-1       ← one per agent instance\n        ├── Agent Identity (SP): agent-2\n        └── Agent Identity (SP): agent-3\n```\n\n## Prerequisites\n\n### PowerShell (recommended for interactive setup)\n\n```powershell\n# Requires PowerShell 7+\nInstall-Module Microsoft.Graph.Beta.Applications -Scope CurrentUser -Force\n```\n\n### Python (for programmatic provisioning)\n\n```bash\npip install azure-identity requests\n```\n\n### Required Entra Roles\n\nOne of: **Agent Identity Developer**, **Agent Identity Administrator**, or **Application Administrator**.\n\n## Environment Variables\n\n```bash\nAZURE_TENANT_ID=\u003Cyour-tenant-id>\nAZURE_CLIENT_ID=\u003Capp-registration-client-id>\nAZURE_CLIENT_SECRET=\u003Capp-registration-secret>\n```\n\n## Authentication\n\n> **⚠️ `DefaultAzureCredential` is NOT supported.** Azure CLI tokens contain\n> `Directory.AccessAsUser.All`, which Agent Identity APIs explicitly reject (403).\n> You MUST use a dedicated app registration with `client_credentials` flow or\n> connect via `Connect-MgGraph` with explicit delegated scopes.\n\n### PowerShell (delegated permissions)\n\n```powershell\nConnect-MgGraph -Scopes @(\n    \"AgentIdentityBlueprint.Create\",\n    \"AgentIdentityBlueprint.ReadWrite.All\",\n    \"AgentIdentityBlueprintPrincipal.Create\",\n    \"User.Read\"\n)\nSet-MgRequestContext -ApiVersion beta\n\n$currentUser = (Get-MgContext).Account\n$userId = (Get-MgUser -UserId $currentUser).Id\n```\n\n### Python (application permissions)\n\n```python\nimport os\nimport requests\nfrom azure.identity import ClientSecretCredential\n\ncredential = ClientSecretCredential(\n    tenant_id=os.environ[\"AZURE_TENANT_ID\"],\n    client_id=os.environ[\"AZURE_CLIENT_ID\"],\n    client_secret=os.environ[\"AZURE_CLIENT_SECRET\"],\n)\ntoken = credential.get_token(\"https:\u002F\u002Fgraph.microsoft.com\u002F.default\")\n\nGRAPH = \"https:\u002F\u002Fgraph.microsoft.com\u002Fbeta\"\nheaders = {\n    \"Authorization\": f\"Bearer {token.token}\",\n    \"Content-Type\": \"application\u002Fjson\",\n    \"OData-Version\": \"4.0\",  # Required for all Agent Identity API calls\n}\n```\n\n## Core Workflow\n\n### Step 1: Create Agent Identity Blueprint\n\nSponsors are required and **must be User objects** — ServicePrincipals and Groups are rejected.\n\n```python\nimport subprocess\n\n# Get sponsor user ID (client_credentials has no user context, so use az CLI)\nresult = subprocess.run(\n    [\"az\", \"ad\", \"signed-in-user\", \"show\", \"--query\", \"id\", \"-o\", \"tsv\"],\n    capture_output=True, text=True, check=True,\n)\nuser_id = result.stdout.strip()\n\nblueprint_body = {\n    \"@odata.type\": \"Microsoft.Graph.AgentIdentityBlueprint\",\n    \"displayName\": \"My Agent Blueprint\",\n    \"sponsors@odata.bind\": [\n        f\"https:\u002F\u002Fgraph.microsoft.com\u002Fbeta\u002Fusers\u002F{user_id}\"\n    ],\n}\nresp = requests.post(f\"{GRAPH}\u002Fapplications\", headers=headers, json=blueprint_body)\nresp.raise_for_status()\n\nblueprint = resp.json()\napp_id = blueprint[\"appId\"]\nblueprint_obj_id = blueprint[\"id\"]\n```\n\n### Step 2: Create BlueprintPrincipal\n\n> **This step is mandatory.** Creating a Blueprint does NOT auto-create its\n> service principal. Without this, Agent Identity creation fails with:\n> `400: The Agent Blueprint Principal for the Agent Blueprint does not exist.`\n\n```python\nsp_body = {\n    \"@odata.type\": \"Microsoft.Graph.AgentIdentityBlueprintPrincipal\",\n    \"appId\": app_id,\n}\nresp = requests.post(f\"{GRAPH}\u002FservicePrincipals\", headers=headers, json=sp_body)\nresp.raise_for_status()\n```\n\nIf implementing idempotent scripts, check for and create the BlueprintPrincipal\neven when the Blueprint already exists (a previous run may have created the Blueprint\nbut crashed before creating the SP).\n\n### Step 3: Create Agent Identities\n\n```python\nagent_body = {\n    \"@odata.type\": \"Microsoft.Graph.AgentIdentity\",\n    \"displayName\": \"my-agent-instance-1\",\n    \"agentIdentityBlueprintId\": app_id,\n    \"sponsors@odata.bind\": [\n        f\"https:\u002F\u002Fgraph.microsoft.com\u002Fbeta\u002Fusers\u002F{user_id}\"\n    ],\n}\nresp = requests.post(f\"{GRAPH}\u002FservicePrincipals\", headers=headers, json=agent_body)\nresp.raise_for_status()\nagent = resp.json()\n```\n\n## API Reference\n\n| Operation | Method | Endpoint | OData Type |\n|-----------|--------|----------|------------|\n| Create Blueprint | `POST` | `\u002Fapplications` | `Microsoft.Graph.AgentIdentityBlueprint` |\n| Create BlueprintPrincipal | `POST` | `\u002FservicePrincipals` | `Microsoft.Graph.AgentIdentityBlueprintPrincipal` |\n| Create Agent Identity | `POST` | `\u002FservicePrincipals` | `Microsoft.Graph.AgentIdentity` |\n| List Agent Identities | `GET` | `\u002FservicePrincipals?$filter=...` | — |\n| Delete Agent Identity | `DELETE` | `\u002FservicePrincipals\u002F{id}` | — |\n| Delete Blueprint | `DELETE` | `\u002Fapplications\u002F{id}` | — |\n\nAll endpoints use base URL: `https:\u002F\u002Fgraph.microsoft.com\u002Fbeta`\n\n## Required Permissions\n\n| Permission | Purpose |\n|-----------|---------|\n| `Application.ReadWrite.All` | Blueprint CRUD (application objects) |\n| `AgentIdentityBlueprint.Create` | Create new Blueprints |\n| `AgentIdentityBlueprint.ReadWrite.All` | Read\u002Fupdate Blueprints |\n| `AgentIdentityBlueprintPrincipal.Create` | Create BlueprintPrincipals |\n| `AgentIdentity.Create.All` | Create Agent Identities |\n| `AgentIdentity.ReadWrite.All` | Read\u002Fupdate Agent Identities |\n\nThere are **18 Agent Identity-specific** Graph application permissions. Discover all:\n```bash\naz ad sp show --id 00000003-0000-0000-c000-000000000000 \\\n  --query \"appRoles[?contains(value, 'AgentIdentity')].{id:id, value:value}\" -o json\n```\n\nGrant admin consent (required for application permissions):\n```bash\naz ad app permission admin-consent --id \u003Cclient-id>\n```\n\n> Admin consent may fail with 404 if the service principal hasn't replicated. Retry with 10–40s backoff.\n\n## Cleanup\n\n```python\n# Delete Agent Identity\nrequests.delete(f\"{GRAPH}\u002FservicePrincipals\u002F{agent['id']}\", headers=headers)\n\n# Delete BlueprintPrincipal (get SP ID first)\nsps = requests.get(\n    f\"{GRAPH}\u002FservicePrincipals?$filter=appId eq '{app_id}'\",\n    headers=headers,\n).json()\nfor sp in sps.get(\"value\", []):\n    requests.delete(f\"{GRAPH}\u002FservicePrincipals\u002F{sp['id']}\", headers=headers)\n\n# Delete Blueprint\nrequests.delete(f\"{GRAPH}\u002Fapplications\u002F{blueprint_obj_id}\", headers=headers)\n```\n\n## Best Practices\n\n1. **Always create BlueprintPrincipal after Blueprint** — not auto-created; implement idempotent checks on both\n2. **Use User objects as sponsors** — ServicePrincipals and Groups are rejected\n3. **Handle permission propagation delays** — after admin consent, wait 30–120s; retry with backoff on 403\n4. **Include `OData-Version: 4.0` header** on every Graph request\n5. **Use Workload Identity Federation for production auth** — for local dev, use a client secret on the Blueprint (see [references\u002Foauth2-token-flow.md](references\u002Foauth2-token-flow.md))\n6. **Set `identifierUris` on Blueprint** before using OAuth2 scoping (`api:\u002F\u002F{app-id}`)\n7. **Never use Azure CLI tokens** for API calls — they contain `Directory.AccessAsUser.All` which is hard-rejected\n8. **Check for existing resources** before creating — implement idempotent provisioning\n\n## References\n\n| File | Contents |\n|------|----------|\n| [references\u002Foauth2-token-flow.md](references\u002Foauth2-token-flow.md) | Production (Managed Identity + WIF) and local dev (client secret) token flows |\n| [references\u002Fknown-limitations.md](references\u002Fknown-limitations.md) | 29 known issues organized by category (from official preview known-issues page) |\n\n### External Links\n\n| Resource | URL |\n|----------|-----|\n| Official Setup Guide | https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fentra\u002Fagent-id\u002Fidentity-platform\u002Fagent-id-setup-instructions |\n| AI-Guided Setup | https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fentra\u002Fagent-id\u002Fidentity-platform\u002Fagent-id-ai-guided-setup |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fentra-agent-id",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill entra-agent-id",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill entra-agent-id",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill entra-agent-id","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fentra-agent-id\u002FSKILL.md",true,[],[49,58,67,76,82,88],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[55,56,57],"model","model hierarchy","model hierarchy skill",{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[64,65,66],"MCP","zoom","zoom mcp",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[73,74,75,65],"sdk","zoom apps sdk","apps",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[78],{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[90]]