Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don’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.
For information on optimizing tool usage, see best practices.
Migrating from
agent.as_tool or Connected Agents? The Connected Agents tool from the previous (classic) Agents API isn’t available in the new Foundry Agent Service. To use one Foundry agent from another, choose one of the following replacements:- A2A tool (this article): Call any A2A-compatible endpoint from your agent. To call another Foundry agent this way, expose that agent as an A2A endpoint by following Host an A2A-compatible agent endpoint later in this article, then connect to it from your calling agent.
- Workflows: Orchestrate multiple Foundry agents declaratively in a sequential, group chat, or human-in-the-loop pattern. See Build a workflow in Microsoft Foundry.
Usage support
The following table shows SDK and setup support.Prerequisites
- An Azure subscription with an active Foundry project.
- A model deployment (for example,
gpt-4.1-mini) in your Foundry project. - Required Azure role: On the Foundry resource, Contributor or Owner for management and Foundry User for building an agent.
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.
- SDK installation:
- Python (GA):
pip install "azure-ai-projects>=2.0.0" - C#:
Azure.AI.ProjectsNuGet package - TypeScript (GA):
@azure/ai-projectsnpm package - Java:
com.azure:azure-ai-agents:2.0.0Maven dependency
- Python (GA):
- Values to update in code:
- Project endpoint URL (for example,
https://<resource>.ai.azure.com/api/projects/<project>). - Model deployment name (for example,
gpt-4.1-mini). - A2A connection name (created in the Foundry portal).
- A2A base URI (optional, only needed for non-
RemoteA2Aconnections).
- Project endpoint URL (for example,
- An A2A connection configured in your Foundry project. For connection setup and REST examples, see Create an A2A connection.
Create an A2A connection
Create a project connection for your A2A endpoint so you can store authentication securely and reuse it across agent versions. For details about supported authentication approaches, see Agent2Agent (A2A) authentication.Create the connection in the Foundry portal
- Sign in to Microsoft Foundry. Make sure the New Foundry toggle is on. These steps refer to Foundry (new).

- Select Tools.
- Select Connect tool.
- Select the Custom tab.
- Select Agent2Agent (A2A), and then select Create.
- Enter a Name and an A2A Agent Endpoint.
- Under Authentication, select an authentication method. For key-based authentication, set the credential name (for example,
x-api-key) and the corresponding secret value.
Get the connection identifier for code
Use your connection name in code. Your code uses this name to retrieve the full connection ID at runtime:- Python/C#/TypeScript: Call
project.connections.get(connection_name)to get the connection object, then accessconnection.id. - REST API: Include the connection ID in the
project_connection_idfield of the A2A tool definition.
Code example
Troubleshooting
Host an A2A-compatible agent endpoint
You can expose your Foundry agent as an A2A endpoint directly by enabling the A2A protocol on the agent. For step-by-step instructions, see Enable incoming A2A on a Foundry agent. If your agent is deployed outside of Agent Service, or if you need a custom hosting approach, use one of the following alternatives.Option 1: Register a custom A2A agent in Foundry Control Plane
If you already have an agent deployed outside of Agent Service that supports the A2A protocol, register it in Foundry Control Plane for centralized management, observability, and governance.- Deploy your A2A-compatible agent to any reachable endpoint.
- Register the agent in Foundry Control Plane, and select A2A as the protocol.
- Foundry generates a proxy URL and discovers your agent card at
/.well-known/agent-card.json.
Option 2: Build a custom A2A server that wraps a Foundry agent
Build a lightweight A2A server that delegates to your Foundry agent through the Responses API:- Create an A2A server by using the official A2A SDK for your language (Python, .NET, or JavaScript).
- Implement the server to call your Foundry agent through the Responses API.
- Serve an agent card at
/.well-known/agent-card.jsonthat describes your agent’s capabilities. - Deploy the server and register it in Foundry Control Plane.