Getting Started with Microsoft Agent Framework: Python & .NET Quickstart

Learn Microsoft Agent Framework with working Python and .NET examples. A private preview contributor's guide to building your first AI agent on Microsoft Foundry.

Today feels like a double launch: Microsoft Agent Framework is now in public preview, and iLoveAgents goes live with it.

A few months ago, I joined the private preview, shipped code, and kept thinking: do we really need another framework? A clean rewrite instead of evolving Semantic Kernel felt risky. But once I got hands-on, that skepticism turned into excitement. I filed bugs, gave feedback, and realized — this isn’t just another framework. It’s the one I’d been waiting for: clean abstractions, practical integrations, and the right balance between research and production.

What makes this launch exciting is how new and focused the codebase is. It hasn’t inherited years of legacy or over-engineered complexity.

Until now, Semantic Kernel and AutoGen moved in parallel — two amazing projects, and even different Teams, with distinct missions. Semantic Kernel built the enterprise foundations: connectors, memory, reliability. AutoGen explored coordination, planning, and multi-agent collaboration. Now those paths have merged. The Teams behind both projects are building together — the new heart of Microsoft’s agent ecosystem.

It’s one framework to rule them all — finally, built for both research and reality.

And what I love most is that it starts intentionally minimal — what’s there is purposeful, and what’s missing is opportunity we can shape together. It brings together everything I loved about AutoGen’s flexibility and Semantic Kernel’s production readiness into one coherent experience. Yes, it’s fresh. Yes, there are rough edges. But I’m excited to keep building with it—and iLoveAgents is where I’ll share what I learn, starting with a Python and .NET hello world.

Why Microsoft Agent Framework Matters

Here’s what makes the framework stand out — and why it’s worth your time:

  • Unified SDK and runtime for agents, workflows, and orchestration
  • Deep Microsoft Foundry integration for deployment, observability, and governance
  • Seamless multi-model support — connect agents to Azure OpenAI, OpenAI API, Anthropic Sonnet, and other models hosted in Microsoft Foundry or external providers
  • Built on open standards like OpenAPI, Model Context Protocol (MCP), and Agent-to-Agent (A2A) communication
  • Production-ready features such as telemetry, checkpoints, and human-in-the-loop flows built in from day one

Together, these make Microsoft Agent Framework the path from intelligent-automation experiments to enterprise-grade multi-agent systems — the kind of agents customers actually want in production, not just in demos.

Agent Framework Hello World: Your First Agent

Let’s get concrete. I’ll walk you through building a simple HaikuBot agent in both Python and .NET.

Prerequisites

Before you start, make sure you have:

  • Azure subscription with Azure OpenAI access
  • Azure CLI installed and configured (az --version to check)
  • Python 3.10+ or .NET 8.0+
  • Basic familiarity with async programming

One-Time Setup (Both Languages)

  1. Provision an Azure OpenAI deployment in Microsoft Foundry and note your deployment name (e.g., gpt-5).

  2. Export environment variables (run once in your shell of choice):

    export AZURE_OPENAI_ENDPOINT="https://<your-resource>.openai.azure.com/" export AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME="<your-deployment-name>"
    setx AZURE_OPENAI_ENDPOINT "https://<your-resource>.openai.azure.com/" setx AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME "<your-deployment-name>"
  3. Authenticate with Azure CLI so the SDKs can use your credentials:

    az login

Python Version

Create a folder for your project (e.g., haikubot-python), add a file called haikubot.py, then install the preview SDK and run it:

pip install --pre agent-framework azure-identity azure-ai-agents python haikubot.py

Here’s the complete code:

haikubot.py
import asyncio import os from agent_framework.azure import AzureOpenAIResponsesClient from azure.identity import AzureCliCredential async def main() -> None: endpoint = os.environ["AZURE_OPENAI_ENDPOINT"] deployment = os.environ["AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME"] agent = AzureOpenAIResponsesClient( credential=AzureCliCredential(), endpoint=endpoint, deployment_name=deployment, ).create_agent( name="HaikuBot", instructions="You are the upbeat launch poet for iLoveAgents.", ) response = await agent.run("Write a haiku about Microsoft Agent Framework.") print(response) if __name__ == "__main__": asyncio.run(main())

Expected output:

Agents unite, code flows free, Framework guides the way, Azure's bright new day.

.NET Version

Create a console app, install the preview packages, and replace Program.cs with the code below:

dotnet new console -n HaikubotDotnet cd HaikubotDotnet dotnet add package Azure.AI.OpenAI --prerelease dotnet add package Azure.Identity dotnet add package Microsoft.Agents.AI.OpenAI --prerelease dotnet run

Here’s the code:

Program.cs
#pragma warning disable OPENAI001 using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME") ?? "gpt-5"; AIAgent agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential()) .GetOpenAIResponseClient(deploymentName) .CreateAIAgent( instructions: "You are the upbeat launch poet for iLoveAgents.", name: "HaikuBot"); Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));

Important: Ensure you’re on the latest Azure.AI.OpenAI beta (≥ 2.3.0) to use the Responses API. Earlier versions don’t support it.

From here, you can extend the instructions, register tools, compose planner-executor patterns, or wire agents into larger workflows.

When I say the code is cleaner, I’m not just being vague. Here’s what stands out:

  • Less boilerplate — You don’t need to wire up multiple services and factories
  • Clearer abstractions — AIAgent + .RunAsync() hides complexity without sacrificing power
  • Modular extension points — Attach tools, workflows, and middleware without modifying core code
  • Built-in interoperability — Message passing and agent protocols are standardized, not reinvented

It feels like they took years of learnings from both Semantic Kernel and AutoGen and distilled them into something that just works.

Tradeoffs & When to Wait

I’m excited about Microsoft Agent Framework, but I want to be honest about where it is right now.

This is still preview software. That means:

  • Some enterprise scenarios and connectors aren’t fully hardened yet
  • APIs might change between preview releases
  • Documentation is catching up—expect to read source code sometimes
  • Breaking changes are possible (though the team is minimizing them)

When to use Microsoft Agent Framework:

  • You’re starting a new multi-agent project
  • You want to be part of the ecosystem as it evolves
  • You can handle preview-stage API changes
  • You need tight Microsoft Foundry integration

When to stick with Semantic Kernel (for now):

  • You have existing production applications
  • You need absolute stability today
  • You only need single-agent patterns
  • Your project can’t tolerate breaking changes

My take? If you’re building something new and you’re comfortable with preview software, jump in now. The sooner you start, the more you can influence the direction.

What’s Coming on iLoveAgents

This is why I started iLoveAgents: to track, test, and share what this new agentic era makes possible. Here’s what I’m lining up next:

  • Microsoft Agent Framework multi-agent orchestration patterns (planner + executor + reviewer) with real Microsoft Foundry telemetry
  • Deployment runbooks for moving agents from local development to managed hosting on Microsoft Foundry
  • Tooling deep dives: OpenAPI, Model Context Protocol servers, and responsible AI guardrails
  • Playbooks for production readiness—observability, logging, and human-in-the-loop handoffs

Let’s Build Together

This is just the beginning—for Microsoft Agent Framework and for iLoveAgents. I’m building in public, and I want to hear from you. Share the enterprise AI agents or prototypes you’re building so we can figure out this agentic era together.

What agent scenarios are you exploring? Are you building customer support bots? Research assistants? DevOps automation? I’d love to feature interesting use cases from the community in future posts.

Got questions or feedback? Drop a comment below or reach out on LinkedIn.

Let’s figure out this agentic era together.

Further Reading & Resources