Agentskillz Logo

microsoft/azure-skills / entra-agent-id

entra-agent-id

Установки
274,486
Автор
microsoft/azure-skills

Навык для настройки и управления Microsoft Entra Agent Identities через Microsoft Graph: создание blueprint'ов, принципалов и отдельных агентских удостоверений, настройка OAuth 2.0 обмена токенами (включая OBO и кросс-тенантные сценарии) и выдача разрешений. Полезен для автоматизации аутентификации AI-агентов с изолированными правами и аудитом.

Установить скилл

npx skills add https://github.com/microsoft/azure-skills --skill entra-agent-id

Аудит безопасности

Gen Agent Trust Hub

pass

This skill provides a comprehensive guide and code patterns for managing Microsoft Entra Agent Identity Blueprints and per-instance identities. It utilizes official Microsoft Graph APIs, standard SDKs, and containerized sidecars for identity management. The security posture is aligned with enterprise identity best practices, though users should ensure local secrets are managed according to organization policy.

Audited: 4/29/2026, 5:05:57 PM

Socket

pass

No alerts

Audited: 4/29/2026, 5:07:03 PM

Snyk

pass

Risk: LOW · No issues

Audited: 4/29/2026, 5:05:48 PM

Промпт скилла

Microsoft Entra Agent ID

Create and manage OAuth 2.0-capable identities for AI agents using Microsoft Graph. Every agent instance gets a distinct identity, audit trail, and independently-scoped permission grants.

Quick Reference

PropertyValue
ServiceMicrosoft Entra Agent ID
APIMicrosoft Graph (https://graph.microsoft.com/v1.0)
Required roleAgent Identity Developer, Agent Identity Administrator, or Application Administrator
Object modelBlueprint (application) → BlueprintPrincipal (SP) → Agent Identity (SP)
Runtime exchangeTwo-step fmi_path exchange (autonomous and OBO)
.NET helperMicrosoft.Identity.Web.AgentIdentities
Polyglot helperMicrosoft Entra SDK for AgentID (sidecar container)

When to Use This Skill

  • Provisioning a new Agent Identity Blueprint and BlueprintPrincipal
  • Creating per-instance Agent Identities under a Blueprint
  • Configuring credentials (FIC, Managed Identity, or client secret) on the Blueprint
  • Implementing the two-step fmi_path runtime token exchange (autonomous or OBO)
  • Cross-tenant agent token flows
  • Deploying the Microsoft Entra SDK for AgentID sidecar for polyglot agents (Python, Node, Go, Java)
  • Granting per-Agent-Identity application (appRoleAssignments) or delegated (oauth2PermissionGrants) permissions
  • Diagnosing Agent ID errors such as AADSTS82001, AADSTS700211, or PropertyNotCompatibleWithAgentIdentity

MCP Tools

ToolUse
mcp_azure_mcp_documentationSearch Microsoft Learn for current Agent ID setup, Graph API shapes, and SDK configuration

There is no dedicated Agent Identity MCP server today. This skill guides direct Microsoft Graph API calls (PowerShell or Python requests). Use mcp_azure_mcp_documentation to verify request bodies and endpoints against current docs before running.

Before You Start

Use the mcp_azure_mcp_documentation tool to search Microsoft Learn for current Agent ID documentation:

  • "Microsoft Entra Agent ID setup instructions"
  • "Microsoft Entra SDK for AgentID"

Verify request bodies and endpoints against the installed SDK version — Graph API shapes evolve.

Conceptual Model

Agent Identity Blueprint (application)         ← one per agent type/project
  └── BlueprintPrincipal (service principal)    ← MUST be created explicitly
        ├── Agent Identity (SP): agent-1        ← one per agent instance
        ├── Agent Identity (SP): agent-2
        └── Agent Identity (SP): agent-3
ConceptDescription
BlueprintApplication object that defines a type/class of agent. Holds credentials (secret, certificate, federated identity).
BlueprintPrincipalService principal for the Blueprint in the tenant. Not auto-created.
Agent IdentityService-principal-only identity for a single agent instance. Cannot hold its own credentials.
SponsorA User (or Group, for Agent Identity) who is responsible for the identity. Required on creation.

Prerequisites

Required Entra Roles

One of: Agent Identity Developer, Agent Identity Administrator, or Application Administrator.

PowerShell (interactive setup)

# PowerShell 7+
Install-Module Microsoft.Graph.Applications -Scope CurrentUser -Force

Python (programmatic provisioning)

pip install azure-identity requests

Authentication

DefaultAzureCredential is not supported. Azure CLI tokens carry Directory.AccessAsUser.All, which Agent Identity APIs hard-reject (403). Use a dedicated app registration with client_credentials, or Connect-MgGraph with explicit delegated scopes.

PowerShell (delegated)

Connect-MgGraph -Scopes @(
    "AgentIdentityBlueprint.Create",
    "AgentIdentityBlueprint.ReadWrite.All",
    "AgentIdentityBlueprintPrincipal.Create",
    "AgentIdentity.Create.All",
    "User.Read"
)

Python (application)

import os, requests
from azure.identity import ClientSecretCredential

credential = ClientSecretCredential(
    tenant_id=os.environ["AZURE_TENANT_ID"],
    client_id=os.environ["AZURE_CLIENT_ID"],
    client_secret=os.environ["AZURE_CLIENT_SECRET"],
)
token = credential.get_token("https://graph.microsoft.com/.default")

GRAPH = "https://graph.microsoft.com/v1.0"
headers = {
    "Authorization": f"Bearer {token.token}",
    "Content-Type": "application/json",
    "OData-Version": "4.0",
}

Core Workflow

Step 1: Create Agent Identity Blueprint

Use the typed endpoint. Sponsors must be Users at Blueprint creation. This snippet assumes the requests client and headers dict from the Python authentication block above.

import subprocess
import requests

user_id = subprocess.run(
    ["az", "ad", "signed-in-user", "show", "--query", "id", "-o", "tsv"],
    capture_output=True, text=True, check=True,
).stdout.strip()

blueprint_body = {
    "displayName": "My Agent Blueprint",
    "sponsors@odata.bind": [
        f"https://graph.microsoft.com/v1.0/users/{user_id}"
    ],
}
resp = requests.post(
    f"{GRAPH}/applications/microsoft.graph.agentIdentityBlueprint",
    headers=headers, json=blueprint_body,
)
resp.raise_for_status()

blueprint = resp.json()
app_id = blueprint["appId"]
blueprint_obj_id = blueprint["id"]

Step 2: Create BlueprintPrincipal

Mandatory. Creating a Blueprint does NOT auto-create its service principal. Skipping this step produces: 400: The Agent Blueprint Principal for the Agent Blueprint does not exist.

sp_body = {"appId": app_id}
resp = requests.post(
    f"{GRAPH}/servicePrincipals/microsoft.graph.agentIdentityBlueprintPrincipal",
    headers=headers, json=sp_body,
)
resp.raise_for_status()

Make your provisioning scripts idempotent — always check for the BlueprintPrincipal even when the Blueprint already exists.

Step 3: Create Agent Identities

Sponsors for an Agent Identity may be Users or Groups.

agent_body = {
    "displayName": "my-agent-instance-1",
    "agentIdentityBlueprintId": app_id,
    "sponsors@odata.bind": [
        f"https://graph.microsoft.com/v1.0/users/{user_id}"
    ],
}
resp = requests.post(
    f"{GRAPH}/servicePrincipals/microsoft.graph.agentIdentity",
    headers=headers, json=agent_body,
)
resp.raise_for_status()
agent = resp.json()
agent_sp_id = agent["id"]

Runtime Authentication

Agents authenticate at runtime using credentials configured on the Blueprint (not on the Agent Identity — Agent Identities can't hold credentials).

OptionUse caseCredential on Blueprint
Managed Identity + WIFProduction (Azure-hosted)Federated Identity Credential
Client secretLocal dev / testingPassword credential
Microsoft Entra SDK for AgentIDPolyglot / 3P agentsSidecar container acquires tokens over HTTP

For the two-step fmi_path exchange (parent token → per-Agent-Identity Graph token) that gives each agent instance a distinct sub claim and audit trail, see references/runtime-token-exchange.md.

For OBO (agent acting on behalf of a user), see references/obo-blueprint-setup.md.

For the containerized polyglot auth sidecar (Python, Node, Go, Java — no SDK embedding), see references/sdk-sidecar.md.

For MI+WIF and client-secret setup details, see references/oauth2-token-flow.md.

.NET quick path

For .NET services, use Microsoft.Identity.Web.AgentIdentities — it handles Federated Identity Credential management and the two-step exchange for you. See the package README at github.com/AzureAD/microsoft-identity-web under src/Microsoft.Identity.Web.AgentIdentities/.

Granting Permissions (Per Agent Identity)

Agent Identities support both application permissions (autonomous) and delegated permissions (OBO). Grants are scoped per Agent Identity, not to the BlueprintPrincipal.

Application permissions (autonomous)

graph_sp = requests.get(
    f"{GRAPH}/servicePrincipals?$filter=appId eq '00000003-0000-0000-c000-000000000000'",
    headers=headers,
).json()["value"][0]

user_read_all = next(r for r in graph_sp["appRoles"] if r["value"] == "User.Read.All")

requests.post(
    f"{GRAPH}/servicePrincipals/{agent_sp_id}/appRoleAssignments",
    headers=headers,
    json={
        "principalId": agent_sp_id,
        "resourceId": graph_sp["id"],
        "appRoleId": user_read_all["id"],
    },
).raise_for_status()

Delegated permissions (OBO)

from datetime import datetime, timedelta, timezone

expiry = (datetime.now(timezone.utc) + timedelta(days=3650)).strftime("%Y-%m-%dT%H:%M:%SZ")

requests.post(
    f"{GRAPH}/oauth2PermissionGrants",
    headers=headers,
    json={
        "clientId": agent_sp_id,
        "consentType": "AllPrincipals",
        "resourceId": graph_sp["id"],
        "scope": "User.Read Tasks.ReadWrite Mail.Send",
        "expiryTime": expiry,
    },
).raise_for_status()

Browser-based admin consent URLs do not work for Agent Identities — use oauth2PermissionGrants for programmatic delegated consent.

Cross-Tenant Agent Identities

Blueprints can be multi-tenant (signInAudience: AzureADMultipleOrgs). When exchanging tokens cross-tenant:

Step 1 of the parent token exchange MUST target the Agent Identity's home tenant, not the Blueprint's. Wrong tenant → AADSTS700211: No matching federated identity record found.

See references/runtime-token-exchange.md for full cross-tenant examples.

API Reference

OperationMethodEndpoint
Create BlueprintPOST/applications/microsoft.graph.agentIdentityBlueprint
Create BlueprintPrincipalPOST/servicePrincipals/microsoft.graph.agentIdentityBlueprintPrincipal
Create Agent IdentityPOST/servicePrincipals/microsoft.graph.agentIdentity
Add FIC to BlueprintPOST/applications/{id}/microsoft.graph.agentIdentityBlueprint/federatedIdentityCredentials
List Agent IdentitiesGET/servicePrincipals/microsoft.graph.agentIdentity
Grant app permissionPOST/servicePrincipals/{id}/appRoleAssignments
Grant delegated permissionPOST/oauth2PermissionGrants
Delete Agent IdentityDELETE/servicePrincipals/{id}
Delete BlueprintDELETE/applications/{id}

Base URL: https://graph.microsoft.com/v1.0.

Required Graph Permissions

PermissionPurpose
AgentIdentityBlueprint.CreateCreate Blueprints
AgentIdentityBlueprint.ReadWrite.AllRead/update Blueprints
AgentIdentityBlueprintPrincipal.CreateCreate BlueprintPrincipals
AgentIdentity.Create.AllCreate Agent Identities
AgentIdentity.ReadWrite.AllRead/update Agent Identities
Application.ReadWrite.AllBlueprint CRUD on application objects
AppRoleAssignment.ReadWrite.AllGrant application permissions
DelegatedPermissionGrant.ReadWrite.AllGrant delegated permissions

Grant admin consent (required for application permissions):

az ad app permission admin-consent --id <client-id>

After admin consent, tokens may not include new claims for 30–120 seconds — retry with exponential backoff.

Best Practices

  1. Always create BlueprintPrincipal after Blueprint — not auto-created.
  2. Use typed endpoints (/applications/microsoft.graph.agentIdentityBlueprint) instead of raw /applications with @odata.type.
  3. Credentials live on the Blueprint — Agent Identities can't hold secrets/certs (PropertyNotCompatibleWithAgentIdentity).
  4. Include OData-Version: 4.0 on every Graph request.
  5. Use Workload Identity Federation for production — client secrets only for local dev.
  6. Set identifierUris: ["api://{appId}"] on the Blueprint before OAuth2 scope resolution.
  7. Never use Azure CLI tokens for Agent Identity APIs — Directory.AccessAsUser.All causes hard 403.
  8. Use fmi_path with client_credentials — NOT RFC 8693 urn:ietf:params:oauth:grant-type:token-exchange (returns AADSTS82001).
  9. Always use /.default scope in both steps of the exchange — individual scopes fail.
  10. Step 1 targets the Agent Identity's home tenant in cross-tenant flows.
  11. Grant permissions per Agent Identity, not to the BlueprintPrincipal.
  12. Handle permission-propagation delays — retry 403s with 30–120s backoff after admin consent.
  13. Keep the Entra SDK for AgentID on localhost — never expose via LoadBalancer or Ingress.

Troubleshooting

ErrorCauseFix
AADSTS82001Used RFC 8693 token-exchange grantUse client_credentials with fmi_path
AADSTS700211Step 1 parent token targeted wrong tenantTarget Agent Identity's home tenant
AADSTS50013OBO user token targets Graph, not BlueprintUse api://{blueprint_app_id}/access_as_user
AADSTS65001Missing grant or used individual scopesUse /.default and verify oauth2PermissionGrants
403 Authorization_RequestDeniedNo grant on this Agent IdentityAdd via appRoleAssignments or oauth2PermissionGrants
PropertyNotCompatibleWithAgentIdentityTried to add credential to Agent Identity SPPut credentials on the Blueprint
Agent Blueprint Principal does not existBlueprintPrincipal not createdStep 2 of the Core Workflow
AADSTS650051 on admin consentSP already exists from partial consentGrant directly via appRoleAssignments

References

FileContents
references/runtime-token-exchange.mdTwo-step fmi_path exchange: autonomous + OBO, cross-tenant
references/oauth2-token-flow.mdMI + WIF (production) and client secret (local dev)
references/obo-blueprint-setup.mdConfiguring the Blueprint as an OAuth2 API for OBO
references/sdk-sidecar.mdMicrosoft Entra SDK for AgentID — architecture, configuration, endpoints
references/sdk-sidecar-deployment.mdSDK code patterns (Python/TypeScript), Docker/Kubernetes manifests, security, troubleshooting
references/known-limitations.mdDocumented gaps organized by category

External Links

ResourceURL
Agent ID Setup Guidehttps://learn.microsoft.com/en-us/entra/agent-id/identity-platform/agent-id-setup-instructions
AI-Guided Setuphttps://learn.microsoft.com/en-us/entra/agent-id/identity-platform/agent-id-ai-guided-setup
Microsoft Entra SDK for AgentIDhttps://learn.microsoft.com/en-us/entra/msidweb/agent-id-sdk/overview
Microsoft.Identity.Web.AgentIdentities (.NET)https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web.AgentIdentities/README.AgentIdentities.md

Все файлы скилла

Другие скиллы автора

azure-diagnostics

554,288 установок

microsoft/azure-skills

Скилл для системной диагностики и устранения проблем Azure в продакшене: от App Service, Functions и AKS до виртуальных машин и очередей сообщений. Использует AppLens, Azure Monitor и проверку ресурсов, чтобы быстро находить первопричины сбоев, анализировать логи и предлагать шаги по восстановлению.

azure-prepare

553,704 установок

microsoft/azure-skills

Скилл готовит проекты к развёртыванию в Azure: анализирует кодовую базу, выбирает подходящий сценарий (Bicep, Terraform или AZD) и создаёт всю необходимую инфраструктуру — план развёртывания, конфигурационные файлы и Dockerfile. Автоматизирует подготовительный этап, чтобы последующая валидация и деплой прошли без ошибок.

azure-ai

553,621 установок

microsoft/azure-skills

Скилл для работы с сервисами Azure AI: поиск (включая векторный и гибридный), распознавание и синтез речи, транскрибация, OCR и документы. Помогает быстро выполнять задачи через MCP-инструменты или подсказывает нужные SDK-примеры для Python, TypeScript и .NET. Ускоряет интеграцию с Azure AI Search, Speech, OpenAI и Document Intelligence.

azure-deploy

553,594 установок

microsoft/azure-skills

Навык автоматизирует развертывание уже подготовленных приложений в Azure с помощью azd, terraform и az deployment. Он проверяет готовность плана, выполняет деплой, обрабатывает ошибки и подтверждает успешный запуск, возвращая ссылки на ресурсы. Полезен для надежного и повторяемого деплоя без ручных шагов.

azure-validate

553,079 установок

microsoft/azure-skills

Проверяет готовность Azure-окружения к развертыванию: конфигурацию, Bicep/Terraform-шаблоны, роли RBAC и разрешения managed identity. Позволяет выявить проблемы до деплоя, сэкономить время и избежать сбоев.

azure-storage

552,529 установок

microsoft/azure-skills

Скилл для работы с Azure Storage: управление блоб-хранилищем, файловыми ресурсами, очередями и таблицами. Помогает выбирать уровни доступа (hot/cool/cold/archive) и варианты избыточности, а также выполнять операции через CLI или MCP. Полезен для загрузки, скачивания и перечисления объектов в облаке Azure.

entra-app-registration

552,269 установок

microsoft/azure-skills

Скилл помогает регистрировать приложения в Microsoft Entra ID, настраивать OAuth 2.0 и подключать MSAL для аутентификации пользователей и сервисов. Охватывает создание app registration, настройку API-разрешений, клиентских секретов и сертификатов, а также лучшие практики безопасности. Удобен для быстрой настройки аутентификации в веб-, мобильных и фоновых приложениях.

appinsights-instrumentation

552,016 установок

microsoft/azure-skills

Скилл предоставляет руководство по инструментированию веб-приложений с помощью Azure Application Insights: описывает паттерны телеметрии, настройку SDK и конфигурацию. Помогает разработчикам добавлять мониторинг в приложения, а также разграничивает случаи, когда следует использовать azure-prepare для внесения изменений в проект.

azure-resource-lookup

551,937 установок

microsoft/azure-skills

Находит и перечисляет ресурсы Azure любого типа по подпискам и группам ресурсов через Azure Resource Graph. Помогает отвечать на вопросы «что у меня есть», искать ресурсы по тегам, обнаруживать осиротевшие диски и неиспользуемые IP-адреса. Используется, когда нет выделенного MCP-инструмента для нужного типа ресурсов.

azure-resource-visualizer

551,932 установок

microsoft/azure-skills

Анализирует группы ресурсов Azure и создает подробные диаграммы архитектуры в формате Mermaid. Помогает визуализировать взаимосвязи между ресурсами, группировать их по слоям и документировать инфраструктуру. Полезен для понимания структуры облачных решений и создания наглядной документации.

azure-compliance

551,896 установок

microsoft/azure-skills

Проводит аудит безопасности и соответствия Azure: оценивает ресурсы по лучшим практикам, находит неверно настроенные и потерянные ресурсы, а также проверяет ключи, секреты и сертификаты Key Vault на истечение срока действия. Помогает выявлять критические риски и планировать их устранение.

azure-aigateway

551,722 установок

microsoft/azure-skills

Настраивает Azure API Management как AI-шлюз для управления моделями, MCP-инструментами и агентами. Включает семантическое кэширование, лимиты токенов, контроль безопасности, балансировку нагрузки и мониторинг. Помогает централизованно управлять доступом к AI-сервисам и снижать расходы.

azure-kusto

551,647 установок

microsoft/azure-skills

Помогает работать с Azure Data Explorer (Kusto): выполнять KQL-запросы, исследовать схему таблиц, анализировать логи, телеметрию и временные ряды. Полезен для поиска аномалий, агре

azure-messaging

541,378 установок

microsoft/azure-skills

Навык для диагностики и устранения неполадок в Azure Messaging SDK (Event Hubs, Service Bus). Помогает решать проблемы с подключением, аутентификацией, обработкой сообщений и конфигурацией. Использует инструменты MCP для проверки состояния ресурсов, поиска документации и анализа ошибок.

azure-compute

495,407 установок

microsoft/azure-skills

Помогает подбирать, сравнивать и создавать виртуальные машины и масштабируемые наборы в Azure, а также оценивать их стоимость. Разбирается в сценариях резервирования мощности, автомасштабирования и управления машинами, направляя запрос к нужному рабочему процессу.

azure-rbac

486,709 установок

microsoft/azure-skills

Помогает подобрать роль Azure RBAC с минимальными правами для идентичности, сгенерировать команды CLI и код Bicep для её назначения. Также подскажет, какие разрешения нужны, чтобы выдать доступ другому пользователю или сервису.

azure-cloud-migrate

485,404 установок

microsoft/azure-skills

Помогает оценить и перенести существующие облачные нагрузки в Azure: конвертирует код и конфигурацию, формирует отчёт о миграции. Поддерживает переезд AWS Lambda, Elastic Beanstalk, Heroku, Google App Engine, Kubernetes, Cloud Run и Spring Boot в Azure Functions, App Service и Container Apps.

azure-hosted-copilot-sdk

438,545 установок

microsoft/azure-skills

Скилл автоматизирует сборку, развертывание и доработку приложений на GitHub Copilot SDK в Azure: определяет наличие SDK в коде, создаёт инфраструктуру, настраивает модели (включая BYOM) и запускает деплой. Полезен, когда нужно быстро подготовить или модифицировать Copilot-приложение без ручной настройки Azure.

azure-quotas

421,637 установок

microsoft/azure-skills

Помогает проверять и управлять квотами Azure: лимитами ресурсов, текущим использованием и доступной ёмкостью в регионах. Позволяет планировать развёртывание, сравнивать регионы по доступности квот, запрашивать увеличение лимитов и избегать ошибок превышения. Использует Azure CLI для точных данных.

azure-upgrade

413,773 установок

microsoft/azure-skills

Навык для оценки и автоматизации обновления Azure-ресурсов: планов, SKU, тарифов, а также модернизации Azure SDK в коде. Поддерживает сценарии: обновление Azure Functions (Consumption→Flex), миграцию App Service на Container Apps, обновление Java SDK (com.microsoft.azure→com.azure) и миграцию Azure Cache

azure-enterprise-infra-planner

388,208 установок

microsoft/azure-skills

Навык проектирует корпоративную инфраструктуру Azure: сети, безопасность, identity, мультирегиональные сценарии. Генерирует код Bicep или Terraform, проверяет его на соответствие лучшим практикам и безопасность, затем разворачивает с подтверждением. Помогает архитекторам и инженерам быстро создавать надёжные облачные решения.

azure-kubernetes

381,128 установок

microsoft/azure-skills

Навык помогает планировать и создавать кластеры Azure Kubernetes Service (AKS): выбирать SKU, проектировать сеть, настраивать безопасность, наблюдаемость, обновления и оптимизацию затрат. Различает решения Day-0 (сеть, API-сервер) и Day-1 (автомасштабирование, VPA, Spot-пулы), предоставляет чек-листы и сценарии для глубокой настройки.

azure-cost

356,363 установок

microsoft/azure-skills

Навык для управления затратами в Azure: позволяет запрашивать исторические данные о расходах, прогнозировать будущие затраты и получать рекомендации по оптимизации. Помогает анализировать затраты по подпискам, группам ресурсов и другим областям, а также выявлять возможности для сокращения расходов.

airunway-aks-setup

300,339 установок

microsoft/azure-skills

Скилл помогает развернуть AI Runway на кластере AKS: проверяет готовность кластера, устанавливает контроллер, выбирает провайдера инференса и запускает модель. Пошагово проводит от начальной настройки до первого развертывания, с проверкой статуса на каждом этапе.