Files
agent-framework/dotnet
T
Roger Barreto 1b7668119d .NET: Enable Microsoft.Agents.AI.FoundryMemory for NuGet release (#4559)
* Enable Microsoft.Agents.AI.FoundryMemory for NuGet release

- Remove IsPackable=false override from .csproj to inherit IsPackable=true from nuget-package.props
- Add project to agent-framework-release.slnf for inclusion in build/sign/publish pipeline

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

* Update FoundryMemoryProvider and MemorySearch sample

- StoreAIContextAsync fires UpdateMemoriesAsync immediately (non-accumulation)
- WhenUpdatesCompletedAsync polls last updateId via GetUpdateResultAsync
- Updated FoundryAgents_Step22_MemorySearch sample to create/destroy memory store
  (matching features/foundry-agent-client pattern)

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

* Update FoundryAgents_Step22_MemorySearch sample

- Sample now creates/destroys memory store (self-contained lifecycle)
- Uses WaitForMemoriesUpdateAsync for seeding memories
- Cleanup in finally block deletes both agent and memory store
- Matches features/foundry-agent-client pattern

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1b7668119d · 2026-03-10 13:52:45 +00:00
History
..
2026-03-04 19:11:30 +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