Files
SergeyMenshykh 9c9d81d8b6 .NET: Improve README: architecture overview, troubleshooting, and sample links (#5002)
* Fix README issues: simplify Azure quickstart, add missing sample links, fix typo

- Replace BearerTokenPolicy Azure snippet with simpler AzureOpenAIClient + DefaultAzureCredential pattern
- Add missing sample links for Python (04-hosting, 05-end-to-end) and .NET (01-get-started, 04-hosting, 05-end-to-end)
- Fix 'infererence' typo in dotnet/samples/README.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add architecture overview and troubleshooting sections to README

- Add ASCII architecture diagram showing AIAgent and Workflow pipelines
- Add agent-vs-workflow decision table with 8 common scenarios
- Add troubleshooting section for authentication issues and environment variables
- Fix 'infererence' typo in dotnet/samples/README.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix architecture diagram alignment

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix diagram

* Update architecture diagram and rename Azure AI Foundry to Microsoft Foundry

- Add A2AAgent and Skills to the architecture diagram
- Rename Azure AI Foundry references to Microsoft Foundry
- Add A2AAgent to agent type descriptions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* adderss comments

* address PR review comments

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9c9d81d8b6 · 2026-03-31 18:44:27 +00:00
History
..
2026-03-30 21:26:05 +00:00

Get Started with Microsoft Agent Framework for C# Developers

Quickstart

Basic Agent - .NET

using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using OpenAI.Responses;

var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!;
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME")!;

var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
    .GetResponsesClient(deploymentName)
    .AsAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");

Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));

Examples & Samples

Agent Framework Documentation