The same assistant on Microsoft Foundry
Microsoft Foundry (formerly Azure AI Foundry) is Microsoft's platform for building and running AI applications and agents. This build keeps the contracts from the overall design and maps each part onto a Foundry or Azure service. It suits teams already standardised on Azure and Entra ID.
| Design part | In Microsoft Foundry |
|---|---|
| Conversation service and agent loop | A Foundry agent in a project, with instructions and tools. A thin service in front handles channels and the state machine |
| Models | Model deployments in the project, reached through the enterprise AI gateway for scanning and budgets |
| Knowledge (RAG) | Azure AI Search index (now presented as Foundry IQ) with a knowledge tool on the agent, filtered by airport and date |
| Tool gateway | The booking API (Application Programming Interface) as an OpenAPI tool, or the MCP (Model Context Protocol) gateway attached as an MCP tool |
| Identity | Microsoft Entra ID, managed identities and role-based access control; no keys in code |
| Safety | Foundry content filters and guardrails, in addition to Prisma AIRS at the gateway |
| Tracing and evaluation | OpenTelemetry traces to Application Insights, and Foundry evaluators for agents |
Build steps
Create the project
One Foundry project per environment, with a managed identity and role assignments for search, storage and the booking API.
Deploy models
Deploy the small and reasoning models and point the project at the enterprise gateway so every call is scanned and budgeted.
Build the knowledge index
Load airport and service documents into Azure AI Search with airport and effective-date fields, and attach it as the agent's knowledge tool.
Register tools
Describe the quote, hold, confirm and commit operations as an OpenAPI tool. The commit operation requires the confirmation token the service issues.
Create the agent
Write the instructions, attach the tools and run threads from the conversation service, one thread per guest conversation.
Trace and evaluate
Turn on tracing, run agent evaluators on the shared evaluation set and gate releases on the result.
Creating the agent
A sketch with the Azure AI Projects SDK (Software Development Kit). The SDK changes quickly, so confirm the current class and method names. The important points are the identity, the tool set and the thread per conversation.
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
project = AIProjectClient(
endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
credential=DefaultAzureCredential(), # managed identity in Azure, your login locally
)
agent = project.agents.create_agent(
model="booking-reasoner", # deployment name, routed through the gateway
name="fbo-booking-assistant",
instructions=open("prompts/booking_assistant.md").read(),
tools=[SEARCH_KNOWLEDGE_TOOL, BOOKING_OPENAPI_TOOL], # knowledge from AI Search, actions via OpenAPI
)
def handle_turn(thread_id: str | None, message: str):
thread = project.agents.threads.get(thread_id) if thread_id else project.agents.threads.create()
project.agents.messages.create(thread_id=thread.id, role="user", content=message)
run = project.agents.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)
return thread.id, runSequence: a Foundry agent run, hold and confirm
The agent decides which tool to call. The service controls when a token exists, so the agent cannot commit on its own initiative.
Keeping the commit safe
- The agent can call quote and hold. Commit is a separate operation that needs a single-use confirmation token issued by the conversation service after the guest's explicit reply.
- The booking API authorises by the guest's verified account, not by anything in the prompt.
- Tool outputs are structured; free-text customer notes are not fed back to the model.
- The Prisma AIRS profile from the previous page is attached at the gateway, so Foundry's own filters are a second layer.
- Handoff is a tool that opens a ticket on the agent desk with the thread attached.
Evaluation in Foundry
Run the shared evaluation set against the agent and score it with evaluators for the things that matter to a booking.
| What is measured | Evaluator | Threshold |
|---|---|---|
| Did the agent understand the request | Intent resolution | At least 0.9 on the set |
| Did it call the right tool with the right arguments | Tool call accuracy | At least 0.95 |
| Did it follow its instructions and policies | Task adherence | At least 0.95 |
| Are policy answers supported by the sources | Groundedness | At least 0.9 |
| Is anything unsafe or leaked | Safety evaluators and a custom check | Zero failures |
Thresholds are illustrative. Set them from your own baseline and review them as the set grows.
When to choose it
| Choose Foundry when | Choose another build when |
|---|---|
| The organisation standardises on Azure, Entra ID and Application Insights | You need to control the graph and its checkpoints in code |
| Managed hosting of agent threads and tools is a benefit | You need to run the agent in a network where Foundry is not available |
| Security and operations teams already work in Azure tools | Your evaluation and tracing tools are built around another stack |
Build this for your business
This example is a booking assistant for a ground-handling network, but the same pattern, a governed gateway, runtime security, grounded knowledge, deterministic commits and measured quality, fits any customer-facing assistant that takes actions. We can scope a pilot on your own systems.
Book a discovery call