Designing an Integration Layer for Agents, Tools and Knowledge
This lesson describes the Azure components that form the integration layer of a production agent system, which routes traffic between agents, models, tools and knowledge sources, applies policies and makes the traffic observable.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how Azure API Management works as an AI gateway and MCP gateway.
- Describe how Foundry tools and connections integrate agents with resources.
- Choose an integration style for agent-to-agent coordination and knowledge routing.
Azure API Management as AI and MCP gateway
Azure API Management (APIM) sits between agents and the services they call. As an AI gateway in front of model deployments, it provides token rate limits and quotas per consumer, load balancing and circuit breaking across several deployments or regions, semantic caching, and token usage metrics for chargeback. Agents call one gateway endpoint, and the platform team can change back ends without changing agent code.
As an MCP gateway, APIM can expose a REST API it manages as a remote MCP server, turning selected operations into MCP tools, or it can front an existing MCP server (for example one hosted on Azure Functions or Logic Apps) to add authentication, rate limits, IP filtering and logging. Policies apply consistently to every agent that uses the tool.
The following diagram shows API Management between agents and the services they call.

AI gateway or MCP gateway?
Foundry connections and tools
Foundry Agent Service integrates agents with resources through tools and connections. Built-in tools include Azure AI Search, Foundry IQ knowledge bases, file search, code interpreter, web search, OpenAPI, MCP and A2A (preview). Connections store endpoints and authentication (managed identity, OAuth identity passthrough or keys) at the project level, so agent definitions reference a connection rather than containing credentials.
Foundry tools and connections
Agent-to-agent coordination and knowledge routing
Coordination between agents uses one of three integration styles. In-process workflows (Foundry workflows, Agent Framework or LangGraph) suit agents owned by one team. A2A suits agents deployed independently. Azure Service Bus suits durable asynchronous hand-offs: one agent places a work item on a queue, and another processes it later with retries and dead-lettering, so neither depends on the other being available.
Knowledge routing sends each query to the right source. Options include a router agent or small classifier that chooses an index, metadata filters that narrow one index, and Foundry IQ knowledge bases whose agentic retrieval plans subqueries across several knowledge sources and merges the results.
The following table summarizes the integration components.
| Traffic | Component | What it adds |
|---|---|---|
| Agent to model | APIM AI gateway | Token limits, load balancing, semantic cache, metrics |
| Agent to tool | MCP server, APIM MCP gateway, Foundry tools | Standard interface, policies, central auth |
| Agent to agent | Workflows, A2A, Service Bus | Typed flow, cross-platform peers, durability |
| Agent to knowledge | AI Search, Foundry IQ, router | Retrieval, planning, source selection |
Coordinating agents and routing knowledge
One gateway for many teams
Six teams build agents that call the same three internal REST APIs and two model deployments. Security requires every tool call to be authenticated with Microsoft Entra ID and logged, and finance requires token usage per team. The platform team wants the LEAST custom code.
API Management meets all requirements with configuration: expose the REST APIs as MCP servers with validate-jwt policies and diagnostic logging, and place the model deployments behind the AI gateway with a subscription per team and token metric policies. Building an MCP server per API in Functions would work but adds code, and per-team keys embedded in agents would not provide Entra ID authentication.
Which two gateway roles can Azure API Management play for agents?
Show answer
An AI gateway in front of models and an MCP gateway in front of tools.
Exam Tips
Remember for the exam
- APIM is both AI gateway (models) and MCP gateway (tools).
- Durable asynchronous agent hand-offs: Azure Service Bus.
- Foundry connections keep credentials out of agent definitions.