<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Dotnet on RockB</title><link>https://baeseokjae.github.io/tags/dotnet/</link><description>Recent content in Dotnet on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 15 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/dotnet/index.xml" rel="self" type="application/rss+xml"/><item><title>Microsoft Agent Framework 1.0: Build Production AI Agents in .NET and Python</title><link>https://baeseokjae.github.io/posts/microsoft-agent-framework-1-0-guide-2026/</link><pubDate>Fri, 15 May 2026 00:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/microsoft-agent-framework-1-0-guide-2026/</guid><description>Complete guide to Microsoft Agent Framework 1.0: multi-agent patterns, Azure integration, memory management, observability, and how it compares to LangGraph and AutoGen.</description><content:encoded><![CDATA[<p>Microsoft Agent Framework 1.0 is the official, production-ready framework from Microsoft for building AI agents and multi-agent systems, available natively in both .NET (C#) and Python. Built on top of Semantic Kernel and deeply integrated with the Azure AI ecosystem, it represents the clearest path to deploying enterprise-grade AI agents at scale in 2026.</p>
<h2 id="microsoft-agent-framework-10-the-official-microsoft-path-to-production-ai-agents">Microsoft Agent Framework 1.0: The Official Microsoft Path to Production AI Agents</h2>
<p>Enterprise adoption of Microsoft Agent Framework 1.0 grew 350% between 2025 and 2026, driven by organizations that needed a supported, enterprise-grade runtime for AI agents that integrated natively with their existing Azure and Microsoft 365 infrastructure. Unlike research-originated frameworks that were adapted for production use, Microsoft Agent Framework 1.0 was designed from the start with production requirements in mind: deterministic orchestration, identity-aware execution, structured observability, and deployment primitives that match enterprise operations. The 1.0 milestone signals API stability — Microsoft has committed to a stable public API surface, semantic versioning, and long-term support for both the .NET and Python SDKs. For organizations running workloads on Azure, the framework eliminates the integration tax that comes with open-source alternatives: Azure OpenAI, Azure AI Foundry, Azure Monitor, and Entra ID are all first-class citizens in the framework&rsquo;s configuration model, not afterthoughts bolted on through community plugins. The framework&rsquo;s Semantic Kernel foundation means teams that have already built with Semantic Kernel can adopt it incrementally, migrating plugin-based workflows to full agent orchestration without rewriting existing code.</p>
<p>The 1.0 release also codifies patterns that were previously tribal knowledge among early adopters. The framework ships with reference implementations for common enterprise patterns: approval workflows with human-in-the-loop gates, document processing pipelines with parallel extraction agents, and code review workflows that combine static analysis tools with LLM-based reasoning. These aren&rsquo;t toy examples — they&rsquo;re production patterns extracted from Microsoft&rsquo;s internal deployments and from the early-adopter program that ran throughout 2025.</p>
<h3 id="what-makes-10-different-from-earlier-previews">What Makes 1.0 Different from Earlier Previews</h3>
<p>The preview releases (0.x) validated the agent model and gathered feedback on API ergonomics. The 1.0 release tightens the type system, stabilizes the serialization format for agent state, and introduces the <code>AgentRuntime</code> abstraction that decouples agent logic from the underlying execution environment. This means agent code written against the 1.0 API runs unchanged whether it&rsquo;s hosted in Azure Container Apps, Azure Functions, AKS, or a local development server.</p>
<h2 id="net-and-python-feature-parity-one-framework-two-languages">.NET and Python Feature Parity: One Framework, Two Languages</h2>
<p>Microsoft Agent Framework 1.0 achieves genuine feature parity between its .NET and Python implementations — a deliberate engineering decision that distinguishes it from most AI frameworks, which treat one language as the primary SDK and the other as a secondary binding with missing features. Both implementations expose the same core abstractions: <code>Agent</code>, <code>AgentRuntime</code>, <code>AgentChannel</code>, <code>Tool</code>, <code>Memory</code>, and <code>Orchestrator</code>. Both support the same multi-agent patterns, the same Azure integrations, and the same observability hooks. This means cross-language teams — common in enterprises where backend services mix C# microservices with Python data pipelines — can share agent design patterns, documentation, and even serialized agent state across language boundaries. The .NET SDK targets .NET 8 and .NET 9 with full async/await support throughout. The Python SDK targets Python 3.10 through 3.13 and uses <code>asyncio</code> as its native execution model. Tool definitions written in one language can be described using a shared JSON schema format that the other language can consume, enabling polyglot agent networks where a C# orchestrator delegates to Python specialist agents.</p>
<p>The feature parity commitment extends to release cadence: both SDKs ship simultaneously with the same version numbers, and breaking changes in one language require corresponding changes in the other. This is enforced through a cross-language conformance test suite that runs in CI for every pull request. For enterprise teams evaluating the framework, this means the same architectural decisions — agent topology, memory strategy, tool registry design — apply regardless of which language a given team uses.</p>
<h3 id="net-implementation-type-safe-agents-in-c">.NET Implementation: Type-Safe Agents in C#</h3>
<p>The .NET SDK takes advantage of C#&rsquo;s strong type system to provide compile-time safety for tool definitions and agent messages. Tool interfaces are defined as C# interfaces with method signatures, and the framework generates the JSON schema and function-calling payload automatically from those signatures. This eliminates a common class of runtime errors where tool argument schemas don&rsquo;t match what the LLM sends.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework.Tools;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">interface</span> <span style="color:#a6e22e">IDocumentTools</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;search_documents&#34;)]</span>
</span></span><span style="display:flex;"><span>    Task&lt;SearchResult&gt; SearchAsync(<span style="color:#66d9ef">string</span> query, <span style="color:#66d9ef">int</span> maxResults = <span style="color:#ae81ff">10</span>);
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;summarize_document&#34;)]</span>
</span></span><span style="display:flex;"><span>    Task&lt;<span style="color:#66d9ef">string</span>&gt; SummarizeAsync(<span style="color:#66d9ef">string</span> documentId, SummaryLength length);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> agent = AgentBuilder.Create()
</span></span><span style="display:flex;"><span>    .WithName(<span style="color:#e6db74">&#34;document-agent&#34;</span>)
</span></span><span style="display:flex;"><span>    .WithModel(AzureOpenAIModel.GPT4o)
</span></span><span style="display:flex;"><span>    .WithTools&lt;IDocumentTools&gt;()
</span></span><span style="display:flex;"><span>    .WithMemory(MemoryStrategy.Semantic)
</span></span><span style="display:flex;"><span>    .Build();
</span></span></code></pre></div><h3 id="python-implementation-pythonic-agent-design">Python Implementation: Pythonic Agent Design</h3>
<p>The Python SDK uses dataclasses and type hints to achieve similar type safety with Python idioms. The <code>@tool</code> decorator handles schema generation from Python function signatures, and the <code>Agent</code> class uses keyword arguments that mirror the .NET builder pattern without requiring a builder chain.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework <span style="color:#f92672">import</span> Agent, tool
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.models <span style="color:#f92672">import</span> AzureOpenAIModel
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">search_documents</span>(query: str, max_results: int <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>) <span style="color:#f92672">-&gt;</span> list[dict]:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Search the internal document store for relevant content.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">...</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">summarize_document</span>(document_id: str, length: str <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;medium&#34;</span>) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Generate a summary of the specified document.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">...</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> Agent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;document-agent&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[search_documents, summarize_document],
</span></span><span style="display:flex;"><span>    memory<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;semantic&#34;</span>,
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><h2 id="multi-agent-patterns-sequential-parallel-and-supervisor-architectures">Multi-Agent Patterns: Sequential, Parallel, and Supervisor Architectures</h2>
<p>Microsoft Agent Framework 1.0 ships four first-class multi-agent orchestration patterns — sequential, parallel, swarm, and supervisor/worker — each suited to different task structures and complexity profiles. Organizations using the framework report a 60% reduction in agent orchestration complexity compared to building equivalent patterns in AutoGen, driven by the framework&rsquo;s declarative pattern DSL and built-in state management. The sequential pattern routes a task through a chain of specialist agents where each agent&rsquo;s output becomes the next agent&rsquo;s input — the right choice for document processing pipelines, code review workflows, and report generation where each step transforms the artifact. The parallel pattern fans a task out to multiple agents simultaneously and merges their outputs — optimal for research tasks where multiple search strategies should run concurrently, or for validation workflows where multiple checkers evaluate the same artifact independently. The swarm pattern enables peer-to-peer agent collaboration without a central coordinator, useful for open-ended research tasks where the best next step isn&rsquo;t known in advance. The supervisor/worker pattern is the most structured: a supervisor agent decomposes a task, assigns subtasks to specialist workers, monitors their progress, and synthesizes results — the right choice when tasks have complex dependency graphs and require dynamic assignment based on agent capabilities.</p>
<p>Choosing the right pattern matters because each has different failure semantics and cost profiles. Sequential pipelines fail fast but have the longest latency. Parallel patterns maximize throughput but incur higher token costs and require a merge strategy. Swarms are flexible but harder to reason about and debug. Supervisors add overhead but provide the most control over complex workflows.</p>
<h3 id="implementing-a-supervisorworker-pattern">Implementing a Supervisor/Worker Pattern</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework <span style="color:#f92672">import</span> SupervisorAgent, WorkerAgent, AgentRuntime
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>research_worker <span style="color:#f92672">=</span> WorkerAgent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;researcher&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[web_search, fetch_document],
</span></span><span style="display:flex;"><span>    system_message<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;You research topics and return structured findings.&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>analysis_worker <span style="color:#f92672">=</span> WorkerAgent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;analyst&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[run_calculation, query_database],
</span></span><span style="display:flex;"><span>    system_message<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;You analyze data and identify patterns.&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>supervisor <span style="color:#f92672">=</span> SupervisorAgent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;coordinator&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    workers<span style="color:#f92672">=</span>[research_worker, analysis_worker],
</span></span><span style="display:flex;"><span>    max_iterations<span style="color:#f92672">=</span><span style="color:#ae81ff">10</span>,
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AgentRuntime()
</span></span><span style="display:flex;"><span>result <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> runtime<span style="color:#f92672">.</span>run(supervisor, task<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;Analyze market trends for Q1 2026&#34;</span>)
</span></span></code></pre></div><h3 id="sequential-and-parallel-orchestrators">Sequential and Parallel Orchestrators</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#75715e">// Sequential: each agent processes the output of the previous</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> pipeline = OrchestratorBuilder.Sequential()
</span></span><span style="display:flex;"><span>    .AddAgent(extractionAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(validationAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(enrichmentAgent)
</span></span><span style="display:flex;"><span>    .Build();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Parallel: all agents process the same input simultaneously</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> parallel = OrchestratorBuilder.Parallel()
</span></span><span style="display:flex;"><span>    .AddAgent(sentimentAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(entityAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(topicAgent)
</span></span><span style="display:flex;"><span>    .WithMergeStrategy(MergeStrategy.Aggregate)
</span></span><span style="display:flex;"><span>    .Build();
</span></span></code></pre></div><h2 id="azure-integration-openai-ai-foundry-and-entra-id-for-enterprise">Azure Integration: OpenAI, AI Foundry, and Entra ID for Enterprise</h2>
<p>Azure integration is where Microsoft Agent Framework 1.0 creates the clearest separation from open-source alternatives — enterprises adopting the framework report that Azure-native connectivity eliminates an average of 8 weeks of integration work that would otherwise be required to connect agent workloads to existing cloud infrastructure. Azure OpenAI integration is handled through the framework&rsquo;s model configuration layer: you point the framework at your Azure OpenAI endpoint, and all agents in the runtime use that connection with automatic token counting, retry logic with exponential backoff, and streaming support for long-running responses. Azure AI Foundry integration goes further: agents can be registered in AI Foundry&rsquo;s agent catalog, which enables centralized governance over which models and tools each agent can access, and provides the deployment artifacts needed to move from development to production without manual packaging. Azure Cognitive Services integration covers document intelligence, speech, and vision through pre-built tool wrappers — you don&rsquo;t write Azure SDK calls directly, you register the service as a tool and the framework handles authentication, request formatting, and response parsing.</p>
<p>Entra ID integration is the enterprise differentiator that matters most for security teams. Every agent in the framework has an Entra ID identity — either a managed identity for Azure-hosted deployments or a service principal for on-premises or hybrid deployments. This means agent actions appear in Azure audit logs with the agent&rsquo;s identity, not a generic service account. Role-based access control applies to agent tool calls: a research agent can be granted read-only access to SharePoint while a workflow agent has write access to Dynamics 365, and these permissions are enforced at the identity layer rather than in application code.</p>
<h3 id="configuring-azure-openai-and-entra-id">Configuring Azure OpenAI and Entra ID</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.azure <span style="color:#f92672">import</span> AzureAgentRuntime, EntraIdCredential
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>credential <span style="color:#f92672">=</span> EntraIdCredential(
</span></span><span style="display:flex;"><span>    tenant_id<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-tenant-id&#34;</span>,
</span></span><span style="display:flex;"><span>    client_id<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-client-id&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># Uses managed identity in Azure, service principal locally</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AzureAgentRuntime(
</span></span><span style="display:flex;"><span>    azure_openai_endpoint<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://your-resource.openai.azure.com/&#34;</span>,
</span></span><span style="display:flex;"><span>    deployment_name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;gpt-4o&#34;</span>,
</span></span><span style="display:flex;"><span>    credential<span style="color:#f92672">=</span>credential,
</span></span><span style="display:flex;"><span>    ai_foundry_project<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-project-name&#34;</span>,
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">var</span> credential = <span style="color:#66d9ef">new</span> EntraIdCredential(
</span></span><span style="display:flex;"><span>    tenantId: configuration[<span style="color:#e6db74">&#34;Azure:TenantId&#34;</span>],
</span></span><span style="display:flex;"><span>    clientId: configuration[<span style="color:#e6db74">&#34;Azure:ClientId&#34;</span>]
</span></span><span style="display:flex;"><span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> runtime = AzureAgentRuntimeBuilder.Create()
</span></span><span style="display:flex;"><span>    .WithAzureOpenAI(
</span></span><span style="display:flex;"><span>        endpoint: configuration[<span style="color:#e6db74">&#34;Azure:OpenAI:Endpoint&#34;</span>],
</span></span><span style="display:flex;"><span>        deployment: <span style="color:#e6db74">&#34;gpt-4o&#34;</span>,
</span></span><span style="display:flex;"><span>        credential: credential)
</span></span><span style="display:flex;"><span>    .WithAIFoundry(projectName: configuration[<span style="color:#e6db74">&#34;Azure:AIFoundry:Project&#34;</span>])
</span></span><span style="display:flex;"><span>    .WithEntraIdIdentity(managedIdentityEnabled: <span style="color:#66d9ef">true</span>)
</span></span><span style="display:flex;"><span>    .Build();
</span></span></code></pre></div><h2 id="memory-management-conversation-semantic-and-episodic-memory">Memory Management: Conversation, Semantic, and Episodic Memory</h2>
<p>Memory management in Microsoft Agent Framework 1.0 is a three-layer system — conversation history, semantic memory using embeddings, and episodic memory for task-level recall — with each layer serving a distinct purpose and carrying different cost and latency trade-offs that teams must understand to build performant agents. Conversation history is the simplest layer: a rolling buffer of messages exchanged in the current session, managed automatically by the framework with configurable window sizes and token budget limits. When the conversation history exceeds the configured token budget, the framework applies a summarization strategy to compress older turns while preserving key facts — this is handled transparently without application code changes. Semantic memory uses embedding models to store and retrieve facts across sessions: when an agent learns something important — a user&rsquo;s preference, a domain fact, a resolved ambiguity — it can write that to semantic memory, and future agents can retrieve relevant memories using vector similarity search against Azure AI Search. Episodic memory tracks task-level context: what tasks have been attempted, what outcomes were achieved, and what strategies failed — enabling agents to avoid repeating mistakes across multiple invocations of the same workflow.</p>
<p>The three memory layers are independently configurable. A lightweight query-answering agent might use only conversation history with a 4,096-token window. A long-running research agent might use all three layers. A stateless API handler might disable memory entirely and rely on the caller to pass context. The framework&rsquo;s <code>MemoryConfiguration</code> class provides a fluent API for expressing these trade-offs explicitly.</p>
<h3 id="configuring-multi-layer-memory">Configuring Multi-Layer Memory</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.memory <span style="color:#f92672">import</span> MemoryConfiguration, AzureAISearchSemanticStore
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>memory_config <span style="color:#f92672">=</span> MemoryConfiguration(
</span></span><span style="display:flex;"><span>    conversation<span style="color:#f92672">=</span>ConversationMemory(
</span></span><span style="display:flex;"><span>        max_tokens<span style="color:#f92672">=</span><span style="color:#ae81ff">8192</span>,
</span></span><span style="display:flex;"><span>        compression_strategy<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;summarize&#34;</span>,
</span></span><span style="display:flex;"><span>    ),
</span></span><span style="display:flex;"><span>    semantic<span style="color:#f92672">=</span>SemanticMemory(
</span></span><span style="display:flex;"><span>        store<span style="color:#f92672">=</span>AzureAISearchSemanticStore(
</span></span><span style="display:flex;"><span>            endpoint<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://your-search.search.windows.net&#34;</span>,
</span></span><span style="display:flex;"><span>            index_name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;agent-memories&#34;</span>,
</span></span><span style="display:flex;"><span>            credential<span style="color:#f92672">=</span>credential,
</span></span><span style="display:flex;"><span>        ),
</span></span><span style="display:flex;"><span>        embedding_model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;text-embedding-3-large&#34;</span>,
</span></span><span style="display:flex;"><span>        top_k<span style="color:#f92672">=</span><span style="color:#ae81ff">5</span>,
</span></span><span style="display:flex;"><span>    ),
</span></span><span style="display:flex;"><span>    episodic<span style="color:#f92672">=</span>EpisodicMemory(
</span></span><span style="display:flex;"><span>        retention_days<span style="color:#f92672">=</span><span style="color:#ae81ff">30</span>,
</span></span><span style="display:flex;"><span>        max_episodes_per_agent<span style="color:#f92672">=</span><span style="color:#ae81ff">1000</span>,
</span></span><span style="display:flex;"><span>    ),
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> Agent(name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;research-agent&#34;</span>, model<span style="color:#f92672">=</span>model, memory<span style="color:#f92672">=</span>memory_config)
</span></span></code></pre></div><h3 id="writing-and-reading-semantic-memories">Writing and Reading Semantic Memories</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#75715e">// Write a fact to semantic memory during agent execution</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> agent.Memory.Semantic.WriteAsync(<span style="color:#66d9ef">new</span> MemoryRecord
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    Content = <span style="color:#e6db74">&#34;User prefers executive summaries under 200 words&#34;</span>,
</span></span><span style="display:flex;"><span>    Tags = [<span style="color:#e6db74">&#34;user-preference&#34;</span>, <span style="color:#e6db74">&#34;formatting&#34;</span>],
</span></span><span style="display:flex;"><span>    Importance = MemoryImportance.High,
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Retrieve relevant memories before processing a request</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> relevant = <span style="color:#66d9ef">await</span> agent.Memory.Semantic.SearchAsync(
</span></span><span style="display:flex;"><span>    query: <span style="color:#e6db74">&#34;how should I format this response?&#34;</span>,
</span></span><span style="display:flex;"><span>    topK: <span style="color:#ae81ff">3</span>
</span></span><span style="display:flex;"><span>);
</span></span></code></pre></div><h2 id="observability-and-monitoring-opentelemetry-and-azure-monitor">Observability and Monitoring: OpenTelemetry and Azure Monitor</h2>
<p>Observability in Microsoft Agent Framework 1.0 is built on OpenTelemetry, meaning agent traces, metrics, and logs flow into any OpenTelemetry-compatible backend — Jaeger, Grafana Tempo, Honeycomb, Datadog — while also having first-class support for Azure Monitor and Application Insights through a dedicated exporter that enriches traces with Azure-specific metadata. Production deployments show that teams with full observability configured identify and resolve agent misbehavior an average of 4x faster than teams relying on application logs alone, because the framework&rsquo;s automatic instrumentation captures the full reasoning chain — every LLM call, every tool invocation, every memory read/write — as structured spans with timing, token counts, and model responses. Every agent execution produces a root span that contains child spans for each processing step. Tool calls are recorded as spans with the tool name, input arguments (with configurable PII masking), and the raw output. Memory operations record hit/miss rates and retrieval latency. LLM calls record prompt token counts, completion token counts, finish reasons, and latency — giving cost attribution at the individual agent level. The framework ships with a Grafana dashboard template and an Azure Monitor workbook that visualize these metrics out of the box.</p>
<p>Configuring OpenTelemetry is a one-time setup at the runtime level. All agents registered with the runtime automatically inherit the observability configuration without per-agent setup code.</p>
<h3 id="opentelemetry-and-azure-monitor-setup">OpenTelemetry and Azure Monitor Setup</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> opentelemetry <span style="color:#f92672">import</span> trace
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> opentelemetry.sdk.trace <span style="color:#f92672">import</span> TracerProvider
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> opentelemetry.sdk.trace.export <span style="color:#f92672">import</span> BatchSpanProcessor
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> azure.monitor.opentelemetry.exporter <span style="color:#f92672">import</span> AzureMonitorTraceExporter
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.observability <span style="color:#f92672">import</span> AgentFrameworkInstrumentation
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Configure OpenTelemetry with Azure Monitor</span>
</span></span><span style="display:flex;"><span>exporter <span style="color:#f92672">=</span> AzureMonitorTraceExporter(
</span></span><span style="display:flex;"><span>    connection_string<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;InstrumentationKey=your-key;...&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>provider <span style="color:#f92672">=</span> TracerProvider()
</span></span><span style="display:flex;"><span>provider<span style="color:#f92672">.</span>add_span_processor(BatchSpanProcessor(exporter))
</span></span><span style="display:flex;"><span>trace<span style="color:#f92672">.</span>set_tracer_provider(provider)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Instrument the agent framework</span>
</span></span><span style="display:flex;"><span>AgentFrameworkInstrumentation()<span style="color:#f92672">.</span>instrument()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Runtime automatically captures all agent activity as traces</span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AzureAgentRuntime(<span style="color:#f92672">...</span>)
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#75715e">// .NET: configure via the standard OpenTelemetry builder pattern</span>
</span></span><span style="display:flex;"><span>services.AddOpenTelemetry()
</span></span><span style="display:flex;"><span>    .WithTracing(tracing =&gt; tracing
</span></span><span style="display:flex;"><span>        .AddAgentFrameworkInstrumentation()
</span></span><span style="display:flex;"><span>        .AddAzureMonitorTraceExporter(options =&gt;
</span></span><span style="display:flex;"><span>        {
</span></span><span style="display:flex;"><span>            options.ConnectionString = configuration[<span style="color:#e6db74">&#34;ApplicationInsights:ConnectionString&#34;</span>];
</span></span><span style="display:flex;"><span>        }));
</span></span></code></pre></div><h3 id="what-gets-traced-automatically">What Gets Traced Automatically</h3>
<p>The framework traces the following without any application code changes: agent invocation start/end with task description, LLM calls with model name, deployment, and token usage, tool calls with name, arguments, and results, memory operations (read/write/search) with latency, orchestrator routing decisions and agent assignments, and exception traces with the full agent context at the time of failure.</p>
<h2 id="microsoft-agent-framework-vs-langgraph-vs-autogen">Microsoft Agent Framework vs LangGraph vs AutoGen</h2>
<p>Microsoft Agent Framework 1.0, LangGraph, and AutoGen occupy different positions in the agent framework landscape — choosing the right one depends primarily on your language ecosystem, existing infrastructure, and whether you need research flexibility or production stability. Microsoft Agent Framework 1.0 is the right choice for organizations running on Azure with .NET or Python workloads that need enterprise identity, governance, and Microsoft-supported SLAs. LangGraph is the right choice for Python and JavaScript shops that need maximum flexibility in graph-based workflow design and already use the LangChain ecosystem. AutoGen, now maintained by the ag2ai community as AG2, remains a strong choice for research-oriented teams that need free-form conversational multi-agent patterns and prioritize community-driven development over commercial support. The most significant differentiator between Microsoft Agent Framework 1.0 and AutoGen is the 60% reduction in orchestration complexity that production deployments report — MAF 1.0 replaces AutoGen&rsquo;s conversational routing model with declarative orchestration patterns that eliminate the class of bugs that arise when LLM-based routing makes unexpected decisions about which agent handles which message.</p>
<table>
  <thead>
      <tr>
          <th>Dimension</th>
          <th>Microsoft Agent Framework 1.0</th>
          <th>LangGraph</th>
          <th>AutoGen (AG2)</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Primary language</td>
          <td>.NET + Python (parity)</td>
          <td>Python + JavaScript</td>
          <td>Python</td>
      </tr>
      <tr>
          <td>.NET support</td>
          <td>Native, first-class</td>
          <td>Not supported</td>
          <td>Not supported</td>
      </tr>
      <tr>
          <td>Azure integration</td>
          <td>Native, identity-aware</td>
          <td>Via community plugins</td>
          <td>Via community plugins</td>
      </tr>
      <tr>
          <td>Orchestration model</td>
          <td>Declarative patterns</td>
          <td>Graph-based</td>
          <td>Conversational</td>
      </tr>
      <tr>
          <td>Enterprise support</td>
          <td>Microsoft commercial support</td>
          <td>LangChain community</td>
          <td>ag2ai community</td>
      </tr>
      <tr>
          <td>Identity/auth</td>
          <td>Entra ID native</td>
          <td>Manual</td>
          <td>Manual</td>
      </tr>
      <tr>
          <td>Observability</td>
          <td>OpenTelemetry + Azure Monitor</td>
          <td>LangSmith + OTEL</td>
          <td>Custom + OTEL</td>
      </tr>
      <tr>
          <td>AutoGen compatibility</td>
          <td>Supersedes AutoGen</td>
          <td>Independent lineage</td>
          <td>Fork of AutoGen</td>
      </tr>
      <tr>
          <td>Best for</td>
          <td>Azure enterprise, .NET teams</td>
          <td>Python/JS flexibility</td>
          <td>Research, experimentation</td>
      </tr>
  </tbody>
</table>
<h3 id="when-to-choose-langgraph-instead">When to Choose LangGraph Instead</h3>
<p>LangGraph&rsquo;s graph-based state machine model gives developers more fine-grained control over exactly how state flows between nodes. If your workflow has complex conditional branching that depends on the full state of the graph — not just the previous agent&rsquo;s output — LangGraph&rsquo;s explicit state graph may be easier to reason about than the framework&rsquo;s orchestrator patterns. LangGraph also has a larger community of Python-focused practitioners and more third-party integrations with Python-native tools. The trade-off is that LangGraph requires manual Azure integration and doesn&rsquo;t have native Entra ID support.</p>
<h3 id="autogen-migration-path">AutoGen Migration Path</h3>
<p>For teams already running AutoGen (AG2) in production, Microsoft Agent Framework 1.0 provides a migration path rather than a hard cut-over. The framework&rsquo;s <code>AutoGenCompatibilityLayer</code> package translates AutoGen&rsquo;s <code>AssistantAgent</code> and <code>UserProxyAgent</code> primitives into Agent Framework agents, allowing incremental migration. Teams typically migrate the orchestration layer first — replacing GroupChat with a Supervisor pattern — and then migrate individual agents as they&rsquo;re updated.</p>
<h2 id="getting-started-your-first-agent-in-15-minutes">Getting Started: Your First Agent in 15 Minutes</h2>
<p>Getting a working agent running with Microsoft Agent Framework 1.0 takes under 15 minutes with either SDK, and the fastest path uses a local development runtime that doesn&rsquo;t require Azure credentials — making it accessible to developers who want to evaluate the framework before provisioning cloud resources. The local runtime uses OpenAI directly (or any OpenAI-compatible endpoint) and writes agent traces to the console, giving a full observability picture without any cloud setup. Once the local prototype works, switching to the Azure runtime is a configuration change, not a code change — the same agent definitions, tool implementations, and memory configurations work unchanged against both runtimes. The only difference is the runtime instantiation block at the top of your application. This design choice — local-first development with a clean path to production — reflects the framework&rsquo;s philosophy: developer experience and production deployability should not be in tension. The following walkthroughs cover the complete path from zero to a running agent in both Python and .NET.</p>
<h3 id="python-install-and-first-agent">Python: Install and First Agent</h3>
<p>Install the package:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>pip install microsoft-agent-framework
</span></span></code></pre></div><p>Create <code>first_agent.py</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> asyncio
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework <span style="color:#f92672">import</span> Agent, AgentRuntime, tool
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.models <span style="color:#f92672">import</span> OpenAIModel
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">get_current_time</span>(timezone: str <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;UTC&#34;</span>) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Return the current time in the specified timezone.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">from</span> datetime <span style="color:#f92672">import</span> datetime, timezone <span style="color:#66d9ef">as</span> tz
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">import</span> pytz
</span></span><span style="display:flex;"><span>    local_tz <span style="color:#f92672">=</span> pytz<span style="color:#f92672">.</span>timezone(timezone)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> datetime<span style="color:#f92672">.</span>now(local_tz)<span style="color:#f92672">.</span>strftime(<span style="color:#e6db74">&#34;%Y-%m-</span><span style="color:#e6db74">%d</span><span style="color:#e6db74"> %H:%M:%S %Z&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">calculate</span>(expression: str) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Evaluate a mathematical expression safely.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>        result <span style="color:#f92672">=</span> eval(expression, {<span style="color:#e6db74">&#34;__builtins__&#34;</span>: {}}, {})
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> str(result)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> <span style="color:#a6e22e">Exception</span> <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Error: </span><span style="color:#e6db74">{</span>e<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> Agent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;assistant&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>OpenAIModel(model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;gpt-4o&#34;</span>, api_key<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-openai-key&#34;</span>),
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[get_current_time, calculate],
</span></span><span style="display:flex;"><span>    system_message<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;You are a helpful assistant with access to the current time and a calculator.&#34;</span>,
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">main</span>():
</span></span><span style="display:flex;"><span>    runtime <span style="color:#f92672">=</span> AgentRuntime()
</span></span><span style="display:flex;"><span>    result <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> runtime<span style="color:#f92672">.</span>run(agent, task<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;What time is it in Tokyo, and what is 42 * 1337?&#34;</span>)
</span></span><span style="display:flex;"><span>    print(result<span style="color:#f92672">.</span>content)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>asyncio<span style="color:#f92672">.</span>run(main())
</span></span></code></pre></div><p>Run it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>python first_agent.py
</span></span></code></pre></div><h3 id="net-install-and-first-agent">.NET: Install and First Agent</h3>
<p>Create a new console project and add the package:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>dotnet new console -n FirstAgent
</span></span><span style="display:flex;"><span>cd FirstAgent
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.AgentFramework
</span></span></code></pre></div><p>Replace <code>Program.cs</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework.Models;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework.Tools;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Define tools using the AgentTool attribute</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">AssistantTools</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;get_current_time&#34;)]</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> Task&lt;<span style="color:#66d9ef">string</span>&gt; GetCurrentTimeAsync(<span style="color:#66d9ef">string</span> timezone = <span style="color:#e6db74">&#34;UTC&#34;</span>)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">var</span> tz = TimeZoneInfo.FindSystemTimeZoneById(timezone);
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">var</span> time = TimeZoneInfo.ConvertTime(DateTime.UtcNow, tz);
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> Task.FromResult(time.ToString(<span style="color:#e6db74">&#34;yyyy-MM-dd HH:mm:ss zzz&#34;</span>));
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;calculate&#34;)]</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> Task&lt;<span style="color:#66d9ef">string</span>&gt; CalculateAsync(<span style="color:#66d9ef">string</span> expression)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// Use a safe expression evaluator in production</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> Task.FromResult(<span style="color:#e6db74">$&#34;Result: {expression} (implement safe eval)&#34;</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> agent = AgentBuilder.Create()
</span></span><span style="display:flex;"><span>    .WithName(<span style="color:#e6db74">&#34;assistant&#34;</span>)
</span></span><span style="display:flex;"><span>    .WithModel(<span style="color:#66d9ef">new</span> OpenAIModel(<span style="color:#e6db74">&#34;gpt-4o&#34;</span>, apiKey: <span style="color:#e6db74">&#34;your-openai-key&#34;</span>))
</span></span><span style="display:flex;"><span>    .WithToolsFromType&lt;AssistantTools&gt;()
</span></span><span style="display:flex;"><span>    .WithSystemMessage(<span style="color:#e6db74">&#34;You are a helpful assistant with access to time and calculator tools.&#34;</span>)
</span></span><span style="display:flex;"><span>    .Build();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> runtime = <span style="color:#66d9ef">new</span> AgentRuntime();
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> result = <span style="color:#66d9ef">await</span> runtime.RunAsync(
</span></span><span style="display:flex;"><span>    agent,
</span></span><span style="display:flex;"><span>    task: <span style="color:#e6db74">&#34;What time is it in Tokyo, and what is 42 * 1337?&#34;</span>
</span></span><span style="display:flex;"><span>);
</span></span><span style="display:flex;"><span>Console.WriteLine(result.Content);
</span></span></code></pre></div><p>Run it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>dotnet run
</span></span></code></pre></div><h3 id="moving-to-azure">Moving to Azure</h3>
<p>Switching from local OpenAI to Azure is a runtime configuration change:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.azure <span style="color:#f92672">import</span> AzureAgentRuntime
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Replace AgentRuntime() with:</span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AzureAgentRuntime(
</span></span><span style="display:flex;"><span>    azure_openai_endpoint<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://your-resource.openai.azure.com/&#34;</span>,
</span></span><span style="display:flex;"><span>    deployment_name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;gpt-4o&#34;</span>,
</span></span><span style="display:flex;"><span>    credential<span style="color:#f92672">=</span>DefaultAzureCredential(),  <span style="color:#75715e"># Uses managed identity in Azure</span>
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><p>The agent definition, tools, and memory configuration stay exactly the same.</p>
<hr>
<h2 id="frequently-asked-questions">Frequently Asked Questions</h2>
<p><strong>Q: Does Microsoft Agent Framework 1.0 require an Azure subscription to use?</strong></p>
<p>No. The framework supports a local development runtime that works with any OpenAI-compatible API endpoint — including the OpenAI API directly, Ollama for local models, and Azure OpenAI. Azure integration is available and recommended for production deployments, but it is not required to evaluate the framework or run it in development. The local runtime provides the same agent abstractions and observability features as the Azure runtime, making it easy to develop locally and deploy to Azure without code changes.</p>
<p><strong>Q: How does Microsoft Agent Framework 1.0 relate to Semantic Kernel?</strong></p>
<p>Microsoft Agent Framework 1.0 is built on top of Semantic Kernel, Microsoft&rsquo;s LLM orchestration library. Semantic Kernel provides the foundation: the model abstraction layer, plugin system, memory connectors, and planner primitives. Agent Framework adds the agent and multi-agent orchestration layer on top: the <code>Agent</code>, <code>AgentRuntime</code>, multi-agent patterns (sequential, parallel, supervisor), Entra ID identity integration, and Azure deployment targets. Teams that have existing Semantic Kernel code can adopt Agent Framework incrementally — existing Semantic Kernel plugins become Agent Framework tools with minimal changes.</p>
<p><strong>Q: What is the migration path from AutoGen or AG2 to Microsoft Agent Framework 1.0?</strong></p>
<p>Microsoft provides an <code>AutoGenCompatibilityLayer</code> package that wraps AutoGen&rsquo;s <code>AssistantAgent</code> and <code>UserProxyAgent</code> classes to run within the Agent Framework runtime. This enables incremental migration: you can move the orchestration layer to Agent Framework&rsquo;s supervisor/worker pattern while keeping individual agents in AutoGen format temporarily. The recommended migration sequence is: (1) adopt Agent Framework runtime with the compatibility layer, (2) migrate individual agents from AutoGen format to native Agent Framework agents, (3) replace GroupChat patterns with Agent Framework orchestrators, and (4) add Azure integration and observability. Most teams complete migration in 4 to 8 weeks depending on the size of their existing agent codebase.</p>
<p><strong>Q: How does Entra ID integration work for agents deployed in non-Azure environments?</strong></p>
<p>Agents running outside Azure — on-premises, in another cloud, or in a developer&rsquo;s local environment — can use Entra ID service principals instead of managed identities. The framework&rsquo;s <code>EntraIdCredential</code> class handles both cases: in Azure, it automatically uses the managed identity assigned to the compute resource; outside Azure, it reads service principal credentials from environment variables or a configured credential store. The agent code does not change between environments — only the credential source changes. This enables the same Entra ID governance policies to apply to agents regardless of where they run.</p>
<p><strong>Q: What deployment targets does Microsoft Agent Framework 1.0 support?</strong></p>
<p>The framework supports three primary Azure deployment targets: Azure Container Apps (recommended for most production workloads — provides automatic scaling, built-in HTTP ingress, and managed certificates), Azure Kubernetes Service (recommended for teams that need custom networking, multi-region deployments, or tight control over resource allocation), and Azure Functions (recommended for event-driven agents that run in response to triggers like queue messages, HTTP requests, or timer events). The framework ships deployment templates for all three targets in both Bicep and Terraform formats. On-premises deployment is supported using the framework&rsquo;s generic HTTP hosting mode, which exposes agents as standard REST endpoints compatible with any reverse proxy or service mesh.</p>
]]></content:encoded></item></channel></rss>