Items marked preview in this article are currently in preview. This preview is provided without a service-level agreement, and Microsoft doesn’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Supported agent types
Incoming A2A requires the responses protocol. Prompt agents support the responses protocol by default, and you can expose them as A2A endpoints.Prerequisites
- An Azure subscription with an active Foundry project.
- A deployed prompt agent in Foundry Agent Service.
- Required Azure role: Foundry User or higher on the Foundry project.
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.
Enable incoming A2A
Enabling incoming A2A requires two things: an agent card that describes your agent’s capabilities, and the A2A protocol enabled on the agent endpoint. You can set both in a single PATCH call. This feature isn’t available in the Foundry portal yet—use the REST API or Python SDK.- Foundry portal
- REST API (Bash)
- REST API (PowerShell)
- Python SDK
- C# SDK
- JavaScript/TypeScript SDK
Enabling incoming A2A isn’t yet configurable in the Foundry portal. Use the REST API or Python SDK.
A2A protocol versions
Foundry serves both A2A protocol versions on the same base path (…/endpoint/protocols/a2a). Calling agents select a version in one of three ways:
- Agent card discovery (recommended)—Fetch the version-specific agent card. Foundry publishes the v1.0 card at
…/agentCard/v1.0and the v0.3 card at…/agentCard/v0.3. Each card declares itsprotocolVersion, and most A2A client SDKs use that field to negotiate the version automatically for subsequent requests. - HTTP header—Set
A2A-Version: 1.0(orA2A-Version: 0.3) on the request. - Query string—Append
?a2a-version=1.0(or?a2a-version=0.3) to the request URL.
A2A-Version header and the
a2a-version query string, the values must match. If the values differ,
Foundry returns HTTP 400 with the version-ambiguous problem type or the
JSON-RPC VERSION_AMBIGUOUS reason. Remove one version selector or make the
values identical.
If a request doesn’t specify a version through the
A2A-Version header or a2a-version query string, Foundry serves preview A2A v0.3 by default, in accordance with the A2A specification. For production integrations, explicitly select generally available v1.0 by setting the header, setting the query string, or having your client fetch the v1.0 agent card so the SDK negotiates v1.0 automatically.Understand A2A task and context retention
Foundry retains A2A tasks and contexts for 60 days from their most recent write. Each new write to a task or context resets its 60-day retention period.Verify the agent card
After you enable incoming A2A, your agent exposes the following URLs that calling agents use:-
A2A base path—The root URL for A2A protocol interactions with your agent:
https://{account}.services.ai.azure.com/api/projects/{project}/agents/{agent}/endpoint/protocols/a2a -
Agent card URL (v1.0, recommended)—The discovery endpoint that calling agents use to retrieve your agent’s v1.0 card:
https://{account}.services.ai.azure.com/api/projects/{project}/agents/{agent}/endpoint/protocols/a2a/agentCard/v1.0 -
Agent card URL (v0.3)—The discovery endpoint for the v0.3 card. Use this URL for clients that target A2A v0.3:
https://{account}.services.ai.azure.com/api/projects/{project}/agents/{agent}/endpoint/protocols/a2a/agentCard/v0.3
agent_card PATCH body shown earlier), and Foundry projects the same content into both the v1.0 and v0.3 card shapes.
All A2A URLs require Microsoft Entra ID authentication. Anonymous access to
the agent card isn’t supported. The calling identity must have the
Foundry Agent Consumer role or another Foundry role that grants endpoint
access on the Foundry project or agent.
protocolVersion field matches the version path you requested.
Configure authentication for incoming requests
Incoming A2A requests require Microsoft Entra ID authentication. Key-based authentication and unauthenticated access aren’t supported. The calling agent must present a valid Microsoft Entra token. The identity behind that token must have the Foundry Agent Consumer role, or another Foundry role that grants endpoint access, on the target Foundry project or target agent. Two authentication patterns are supported:On-behalf-of (OBO) the end user
The calling agent passes through the end user’s identity. Your agent receives a token that represents the actual user, so you can scope actions to that user’s permissions. This pattern is appropriate when your agent needs to enforce per-user access control.Service identity (agent identity, service principal, or managed identity)
The calling agent authenticates with its own identity—either the platform-assigned agent identity, a service principal, or a managed identity. Your agent sees the calling service’s identity, not an individual user. This pattern is appropriate for backend agent-to-agent workflows where individual user context isn’t required.Grant access to the A2A endpoint
Assign the Foundry Agent Consumer role to the identity that sends A2A requests. This role provides least-privilege access to agent endpoints without granting permission to create or modify agents. Choose the role-assignment scope based on the access the caller needs:- Assign the role at the target Foundry project scope to allow the identity to call every agent endpoint in the project.
- Assign the role at the target agent scope to allow the identity to call only that agent endpoint.
- For OBO requests, grant access to the end user or a group that contains the user.
- For service-to-service requests, grant access to the calling agent identity, service principal, or managed identity.
- For a new-model Foundry agent, use the identity specified by the agent’s
instance_identity. The agent has this unique identity from creation, and publishing doesn’t change it. - For a legacy Agent Application caller, use the shared project identity before publishing and the distinct Agent Application identity after publishing.
PRINCIPAL_TYPE to User, Group, or ServicePrincipal based on the
calling identity. Agent identities and managed identities use
ServicePrincipal.
When the caller acquires a token directly, request the
https://ai.azure.com/.default scope. For more information about role
assignments, see
Role-based access control for Microsoft Foundry.
Supported A2A transports
Transport support depends on the A2A protocol version:
A2A v1.0 is JSONRPC-only on Foundry’s incoming endpoint. Clients that require HTTP+JSON must either use v0.3 or switch to JSONRPC for v1.0.
Connect to a Foundry A2A agent with the Python A2A SDK
The following example shows how to use the open-source Python A2A SDK to connect to a Foundry agent that has incoming A2A enabled. The SDK reads theprotocolVersion field from the agent card and negotiates the matching protocol version for subsequent requests, so pointing the resolver at agentCard/v1.0 causes the client to use A2A v1.0 end to end.
Because the Foundry agent card requires authentication and uses a custom path (agentCard/v1.0 instead of the default .well-known/agent-card.json), you configure the httpx client with a bearer token and pass the custom agent card path to the resolver.
Install the required packages:
{account}, {project}, and {agent} with your Foundry resource name, project name, and agent name. The resolver constructs the full agent card URL by appending the relative AGENT_CARD_PATH to A2A_BASE_URL.
Connect from another Foundry agent
You can call a Foundry A2A agent from another Foundry agent by using the A2A tool. This section walks through the full setup: create a connection to the target agent, then create a calling agent that uses that connection.Step 1: Create an A2A connection to the target agent
The connection stores the target agent’s A2A endpoint URL and authentication details. For a Foundry agent target, don’t set an agent card path. Foundry resolves the default agent card path automatically and negotiates the A2A protocol version for you.- REST API (Bash)
- REST API (PowerShell)
Set up variables:Create the connection:
Step 2: Create the calling agent with the A2A tool
After the connection exists, create an agent that uses theA2ATool to call the target agent:
Limitations
- Generally available A2A protocol version 1.0 and preview version 0.3 are supported. Other versions aren’t supported.
- For A2A v1.0, only the JSONRPC transport is supported. HTTP+JSON and gRPC aren’t supported for v1.0. See Supported A2A transports.
- Only text modality is supported. File data and other nontext modalities aren’t supported.
- Streaming responses (server-sent events) aren’t supported.
- Incoming A2A requires the responses protocol. Agents that don’t use the responses protocol can’t be exposed as A2A endpoints.
- A2A v0.3 is in preview and isn’t recommended for production workloads. Use v1.0 for production integrations.