-
-
Notifications
You must be signed in to change notification settings - Fork 4
AzureOpenAI
Rasmus Wulff Jensen edited this page Jan 27, 2026
·
4 revisions
- AgentFactory (
AzureOpenAIAgentFactory) - AIToolsFactory integration (tools in
AgentOptions.Tools) - EmbeddingFactory (
AzureOpenAIEmbeddingFactory) - OpenAI-style reasoning settings and
ClientType(ChatClient or ResponsesApi)
dotnet add package AgentFrameworkToolkit.AzureOpenAI
AzureOpenAIAgentFactory agentFactory = new("<endpoint>", "<apiKey>");
AzureOpenAIAgent agent = agentFactory.CreateAgent(new AgentOptions
{
Model = "gpt-5",
ReasoningEffort = OpenAIReasoningEffort.Low,
Instructions = "You are a nice AI"
});
AgentRunResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);Note
In Azure OpenAI, Model refers to your deployment name, not the model id.
AzureOpenAIEmbeddingFactory embeddingFactory = new("<endpoint>", "<apiKey>");
IEmbeddingGenerator<string, Embedding<float>> generator =
embeddingFactory.GetEmbeddingGenerator("text-embedding-3-small");
Embedding<float> embedding = await generator.GenerateAsync("Hello");-
Endpoint(required) -
ApiKeyorCredentials(TokenCredential) for RBAC NetworkTimeoutDefaultClientType-
AutoCorrectFoundryEndpoint(optional, defaults totrue) AdditionalAzureOpenAIClientOptions
builder.Services.AddAzureOpenAIAgentFactory("<endpoint>", "<apiKey>");
builder.Services.AddAzureOpenAIAgentFactory(new AzureOpenAIConnection
{
Endpoint = "<endpoint>",
ApiKey = "<apiKey>"
});
builder.Services.AddAzureOpenAIEmbeddingFactory("<endpoint>", "<apiKey>");- See AgentFactories for shared agent options and middleware.
- See EmbeddingFactories for additional embedding examples.
- See AIToolsFactory for tool creation and MCP support.