
The Architecture Has Changed
Six months ago, building an AI agent on Azure meant building it on OpenAI. That is no longer the case. As of February 2026, Claude Opus 4.6 is available natively in Microsoft Foundry alongside OpenAI's models. The Microsoft Agent Framework now includes first-class support for Anthropic agents in both C# and Python. And through the Model Context Protocol, those agents can connect to virtually any enterprise data source and tool.
This guide walks through the practical architecture for building a Microsoft 365-connected agent using Claude via Azure Foundry — covering what each component does, how they connect, and what decisions you need to make at each step.
Understanding the Stack
Before writing a line of code, it helps to understand the components and how they relate to each other.
Azure Foundry is Microsoft's enterprise AI platform. It provides the infrastructure for deploying, running, and governing AI agents in a secure, scalable cloud environment. It is model-agnostic — it can run Claude, OpenAI models, and others through the same platform with the same governance controls.
The Microsoft Agent Framework is the SDK layer that abstracts the differences between AI providers and gives developers a consistent interface for building agents regardless of which model they choose. It handles agent orchestration, tool routing, memory management, and multi-turn conversation handling.
Claude via Azure Foundry is Anthropic's model running inside Microsoft's infrastructure. The key point is that when Claude runs through Foundry, your enterprise data stays within Microsoft's security boundary. Anthropic operates as a subprocessor, meaning the data governance obligations of your Microsoft 365 tenant extend to Claude's processing.
MCP (Model Context Protocol) is the open standard for connecting AI agents to external tools and data sources. Through MCP, your Claude agent can connect to SharePoint, Teams, Dynamics 365, custom databases, or any service that exposes an MCP server.
Step 1: Set Up Your Azure Foundry Environment
Start by provisioning a Foundry resource in your Azure subscription. You will need to create a Foundry workspace, configure your identity and access management so agents can read from the M365 services you want to connect, and enable the Claude deployment within your Foundry instance.
From the Foundry portal, navigate to the model catalog and select your Claude model. Claude Opus 4.6 is the right choice for complex, long-context tasks. Claude Sonnet 4.6 is the better option for tasks that need fast response times at lower cost. Set your deployment name — this is what you will reference in your agent configuration.
Set the required environment variables your agent will use: your Foundry resource name (the subdomain before .services.ai.azure.com), the deployment name for the Claude model you selected, and your API key or Azure credential configuration depending on your authentication approach.
Step 2: Configure the Agent in the Microsoft Agent Framework
With the Python SDK, the core agent setup is straightforward. Import the AnthropicClient from the agent_framework library, initialise it with your API key and resource configuration, and call the as_agent method to define your agent's name, instructions, and tools. The instructions parameter is where you define the agent's role, constraints, and the context it should apply when processing requests.
For a Microsoft 365-connected agent, the instructions should specify what data sources the agent has access to, what tasks it is authorised to perform, and what it should not do. Being precise here is important — well-scoped instructions produce more reliable agent behaviour than generic ones.
Step 3: Add MCP Connections for Microsoft 365 Data
MCP connections are what give your agent access to live enterprise data. The Microsoft Learn MCP server is a good first connection to add — it lets your agent retrieve documentation and answer technical questions grounded in Microsoft's official knowledge base. For SharePoint access, you will configure an MCP server that connects to your SharePoint tenant and exposes document search and retrieval as agent-callable tools.
The get_mcp_tool method on the client takes the MCP server name and URL and returns a tool object that you pass into your agent's tools list. You can add multiple MCP connections to a single agent, giving it access to a coordinated set of data sources and actions.
Additional tool types available through the framework include web search (for grounding the agent in current external information) and code execution (for agents that need to process data programmatically). These can be combined with MCP connections in the same agent configuration.
Step 4: Implement Extended Thinking for Complex Tasks
Claude's extended thinking feature allows the agent to show its reasoning process — particularly valuable for agents handling complex, multi-step decisions where you want transparency into how the agent reached its conclusion. Enable it by passing a thinking configuration into the agent's parameters.
For enterprise use cases like document review, risk assessment, or proposal generation, extended thinking gives you an audit trail of the agent's reasoning — which is valuable both for quality assurance and for explaining agent decisions to stakeholders who need to understand how outputs were produced.
Step 5: Run, Test, and Govern
Once your agent is configured, run it against representative test cases before deploying to production. Test for instruction-following consistency, boundary behaviour (does the agent stay within its defined scope?), and output quality across the range of inputs it will encounter in real use.
For production governance, register your agent in Microsoft Agent 365 (generally available from May 1, 2026). This gives your IT and security teams visibility into what the agent is doing, what data it is accessing, and what actions it is taking — with the same audit and compliance infrastructure that applies to human M365 activity.
At Trim Journey, we build production-ready Claude agents on Azure Foundry for organisations across industries. Book a 30-minute call to discuss your agent use case and what the build process looks like.


