Lesson 1 of 3 Integration, Zero Trust and State Components

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.

Azure API Management between agents and the services they call. As an AI gateway in front of model deployments it applies token rate limits and quotas per consumer, load balancing and circuit breaking across deployments or regions, semantic caching and token metrics for chargeback. As an MCP gateway it exposes managed REST operations as MCP tools or fronts existing MCP servers with authentication, rate limits, IP filtering and logging. Agents call one endpoint, so back ends can change without changing agent code.
One gateway endpoint, consistent policies.
Sort into groups

AI gateway or MCP gateway?

Exam skills 1.2.1

Decide which API Management gateway role provides each capability.

Log in to try this activity Interactive activities are free with an account.

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.

True or false

Foundry tools and connections

Exam skills 1.2.1

Check how Foundry Agent Service integrates agents with resources.

Log in to try this activity Interactive activities are free with an account.

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.

TrafficComponentWhat it adds
Agent to modelAPIM AI gatewayToken limits, load balancing, semantic cache, metrics
Agent to toolMCP server, APIM MCP gateway, Foundry toolsStandard interface, policies, central auth
Agent to agentWorkflows, A2A, Service BusTyped flow, cross-platform peers, durability
Agent to knowledgeAI Search, Foundry IQ, routerRetrieval, planning, source selection
Scenario questions

Coordinating agents and routing knowledge

Exam skills 1.2.1

Choose the integration style for each coordination or retrieval need.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

Check yourself

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.