Files
agent-framework/docs/docs-templates/getting-started/README.md
T
westey 802c8e6238 Add a script to produce docs by language, and add multi-turn-conversation docs (#510)
* Add a script to produce docs by language, and add multi-turn-conversation docs.

* Fix typo.

* Remove java pivots, move source templates and update comments.

* Add links to docs from root readme
2025-08-28 10:19:24 +00:00

1.8 KiB

Microsoft Agent Framework Getting Started

This guide will help you get up and running quickly with a basic agent using the Agent Framework and Azure OpenAI.

::: zone pivot="programming-language-csharp"

Prerequisites

Before you begin, ensure you have the following:

Note: This demo uses Azure CLI credentials for authentication. Make sure you're logged in with az login and have access to the Azure OpenAI resource. For more information, see the Azure CLI documentation.

Running a Basic Agent Sample

This sample demonstrates how to create and use a simple AI agent with Azure OpenAI as the backend. It will create a basic agent using AzureOpenAIClient with gpt-4o-mini and custom instructions.

Make sure to replace https://your-resource.openai.azure.com/ with the endpoint of your Azure OpenAI resource.

Sample Code

using System;
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Extensions.AI.Agents;
using OpenAI;

AIAgent agent = new AzureOpenAIClient(
  new Uri("https://your-resource.openai.azure.com/"),
  new AzureCliCredential())
    .GetChatClient("gpt-4o-mini")
    .CreateAIAgent(instructions: "You are good at telling jokes.");

Console.WriteLine(await agent.RunAsync("Tell me a joke about a pirate."));

For more details and more advanced scenarios, see Getting Started Steps.

::: zone-end ::: zone pivot="programming-language-python"

Coming Soon

::: zone-end