Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
APPLIES TO: Basic v2 | Standard v2 | Premium v2
API Management supports managing AI agent APIs compatible with the Agent2Agent (A2A) protocol specification. The A2A protocol is an open client-server standard that enables different AI agent systems to communicate and work together using a shared interaction model. With the A2A agent API support in API Management, you can manage and govern agent APIs alongside other API types, including AI model APIs, Model Context Protocol (MCP) tools, and traditional APIs such as REST, SOAP, and GraphQL.
Note
This feature is in preview and has some limitations.
Learn more about managing AI APIs in API Management:
Key capabilities
When you import an A2A agent API, API Management provides the following capabilities:
- Mediates JSON-RPC runtime operations to the A2A backend.
- Enables governance and traffic control using policies.
- When observability through Application Insights is enabled, adds the following A2A-specific attributes to comply with the OpenTelemetry GenAI semantic convention:
genai.agent.id- Set to the agent ID configured in the API settingsgenai.agent.name- Set to the API name in the API settings
- Exposes the agent card with the following transformations:
- Replaces the hostname with API Management instance's hostname.
- Sets the preferred transport protocol to JSON-RPC.
- Removes all other interfaces in
additionalInterfaces. - Rewrites security requirements to include the API Management subscription key requirement.
Prerequisites
An existing API Management instance. Create one if you haven't already.
An existing A2A agent with JSON-RPC operations and an agent card.
Import A2A agent API using the portal
Use the following steps to import an A2A agent API to API Management.
In the Azure portal, go to your API Management instance.
In the left menu, under APIs, select APIs > + Add API.
Select the A2A Agent tile.
Under Agent card, enter the URL that points to the agent card JSON document. Select Next.
On the Create an A2A agent API page, configure the API settings.
- If the Runtime URL and Agent ID aren't automatically configured based on the agent card, then provide the runtime URL of JSON-RPC operations to your agent and the agent ID used in OpenTelemetry traces emitted by the agent (
gen_ai.agent.idattribute). - Under General API settings, enter a Display name of your choice in the API Management instance, and optionally enter a Description.
- Under URL, enter a Base path that your API Management instance uses to access the A2A agent API. API Management displays a Base URL that clients can use to access the JSON-RPC API, and an Agent card URL to access the agent card through API Management.
- If the Runtime URL and Agent ID aren't automatically configured based on the agent card, then provide the runtime URL of JSON-RPC operations to your agent and the agent ID used in OpenTelemetry traces emitted by the agent (
Select Create to create the API.
Configure policies for the A2A agent API
Configure one or more API Management policies to help manage the A2A agent API.
To configure policies for your A2A agent API:
- In the Azure portal, go to your API Management instance.
- In the left-hand menu, under APIs, select your A2A agent API.
- In the left menu, under A2A, select Policies.
- In the policy editor, add or edit the policies you want to apply to the A2A agent API. The policies are defined in XML format.
Note
API Management evaluates policies configured at the global (all APIs) scope before policies at the A2A agent API scope.
Configure subscription key authentication
In the A2A API settings, you can optionally configure subscription key authentication through API Management. Learn more about subscription key authentication.
- Select the API you created in the previous step.
- On the Settings page, under Subscription, select (enable) Subscription required.
If you enable subscription key authentication, clients must include a valid subscription key in the Ocp-Apim-Subscription-Key header or subscription-key query parameter when calling the A2A agent API or accessing the agent card.
Test the A2A agent API
To make sure your A2A agent API works as expected, call the backend through API Management:
- Select the API you created in the previous step.
- On the Overview page, copy the Runtime base URL. Use this URL to call the A2A agent API through API Management.
- Configure a test client or use a tool such as curl to make a
POSTrequest to the agent. If subscription key authentication is enabled, include a valid subscription key header or query parameter in the request.
Tip
Similarly, access the agent card through API Management by making a GET request to the Agent card URL displayed on the Overview page of your A2A agent API.
Limitations
- This feature is currently available only in API Management instances in the v2 tiers.
- Only JSON-RPC-based A2A agent APIs are supported.
- Deserialization of outgoing response bodies isn't supported.
Related content
- API import limitations
- Import an OpenAPI specification
- Import a SOAP API
- Import a SOAP API and convert it to REST
- Import an App Service API
- Import a container app API
- Import a WebSocket API
- Import a GraphQL API
- Import a GraphQL schema and set up field resolvers
- Import a function app API
- Import a logic app API
- Import a Service Fabric service
- Import an Azure AI Foundry API
- Import an Azure OpenAI API
- Import an LLM API
- Import an OData API
- Export a REST API as an MCP server
- Expose an existing MCP server
- Import an A2A agent API
- Import SAP OData metadata
- Import a gRPC API
- Edit an API