Azure.AI.AgentServer.Core 1.0.0-beta.23

Prefix Reserved
This is a prerelease version of Azure.AI.AgentServer.Core.
dotnet add package Azure.AI.AgentServer.Core --version 1.0.0-beta.23
                    
NuGet\Install-Package Azure.AI.AgentServer.Core -Version 1.0.0-beta.23
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Azure.AI.AgentServer.Core" Version="1.0.0-beta.23" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Azure.AI.AgentServer.Core" Version="1.0.0-beta.23" />
                    
Directory.Packages.props
<PackageReference Include="Azure.AI.AgentServer.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Azure.AI.AgentServer.Core --version 1.0.0-beta.23
                    
#r "nuget: Azure.AI.AgentServer.Core, 1.0.0-beta.23"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Azure.AI.AgentServer.Core@1.0.0-beta.23
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Azure.AI.AgentServer.Core&version=1.0.0-beta.23&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Azure.AI.AgentServer.Core&version=1.0.0-beta.23&prerelease
                    
Install as a Cake Tool

Azure AI Agent Server Core library for .NET

Azure.AI.AgentServer.Core is a shared hosting foundation for Azure AI Agent Server packages. It provides a library-owned ASP.NET Core host with built-in OpenTelemetry, health checks, graceful shutdown, and multi-protocol composition — so you can go from dotnet add package to a running agent server in minutes.

Source code | Package (NuGet) | Product documentation

Getting started

Install the package

Install the library for .NET with NuGet:

dotnet add package Azure.AI.AgentServer.Core --prerelease

Prerequisites

Upgrading from a version prior to beta.21? The package has been redesigned as a lightweight hosting foundation. Protocol logic has moved to Azure.AI.AgentServer.Responses and Azure.AI.AgentServer.Invocations. See the Migration Guide for details.

Use the builder pattern to create a server. Protocol packages provide extension methods (AddResponses<T>(), AddInvocations<T>()) to register their endpoints:

var builder = AgentHost.CreateBuilder();

// Register protocol endpoints (protocol packages provide extension methods).
builder.RegisterProtocol("MyProtocol", endpoints =>
{
    endpoints.MapGet("/hello", () => "Hello from the agent server!");
});

var app = builder.Build();
app.Run();

This starts a Kestrel server with OpenTelemetry, a /readiness health endpoint, and the x-platform-server identity header.

Key concepts

AgentHost

The static entry point. AgentHost.CreateBuilder() returns an AgentHostBuilder for composing protocols and configuring the server.

AgentHostBuilder

Configures the underlying ASP.NET Core host with sensible defaults: Kestrel on the PORT environment variable (or 8088), OpenTelemetry traces and metrics, a /readiness health endpoint, and x-platform-server version header. Protocol packages use RegisterProtocol() to add their endpoints — each protocol registers its identity segment with the ServerVersionRegistry.

AgentHostApp

The built application. Call Run() to start listening. Wraps WebApplication with server-specific configuration applied.

FoundryEnvironment

Reads Azure AI Foundry platform variables (FOUNDRY_*, PORT, SSE_KEEPALIVE_INTERVAL) to resolve agent identity, listening port, and connection strings. Also detects OTEL_EXPORTER_OTLP_ENDPOINT and APPLICATIONINSIGHTS_CONNECTION_STRING for telemetry configuration. Useful when your agent server runs as a hosted agent in AI Foundry.

Telemetry

OpenTelemetry is configured automatically via Azure.Monitor.OpenTelemetry.AspNetCore. The Responses and Invocations protocols use dedicated activity source names (Azure.AI.AgentServer.Responses and Azure.AI.AgentServer.Invocations) for distributed tracing. OTLP export is enabled when the OTEL_EXPORTER_OTLP_ENDPOINT environment variable is set.

Health endpoint

A /readiness endpoint is registered by default, responding to liveness and readiness probes. It reports healthy as soon as the host finishes starting.

Examples

You can familiarise yourself with different APIs using Samples.

Troubleshooting

Common errors

  • Port already in use: The server defaults to port 8088 (or the PORT environment variable). If the port is occupied, set PORT to another value or configure Kestrel directly via the builder.
  • No protocol registered: If you use AgentHost.CreateBuilder() without calling RegisterProtocol() (or a protocol extension method), the server will start but will have no protocol endpoints mapped.

Logging

The library emits OpenTelemetry traces via the Azure.AI.AgentServer.Responses and Azure.AI.AgentServer.Invocations activity sources. Inbound request logging is enabled automatically for Tier 1 and Tier 2 setups; for Tier 3, call AddAgentServerCore() and UseAgentServerCore() to enable it. Enable ASP.NET Core logging in your application configuration to diagnose startup issues.

Next steps

  • Samples — Getting started, multi-protocol composition

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Azure.AI.AgentServer.Core:

Package Downloads
Azure.AI.AgentServer.AgentFramework

Package Description

Azure.AI.AgentServer.Responses

An SDK for building ASP.NET Core servers that implement the Azure AI Responses API.

Azure.AI.AgentServer.Invocations

Invocations protocol implementation for Azure AI Agent Server — provides InvocationHandler, endpoint routing, and distributed tracing.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-beta.23 4,449 4/23/2026
1.0.0-beta.22 3,514 4/19/2026
1.0.0-beta.21 1,435 4/15/2026
1.0.0-beta.11 16,419 3/13/2026
1.0.0-beta.10 626 3/11/2026
1.0.0-beta.9 11,574 3/4/2026
1.0.0-beta.8 12,168 2/12/2026
1.0.0-beta.7 225 2/11/2026
1.0.0-beta.6 12,518 1/23/2026
1.0.0-beta.5 29,651 12/7/2025
1.0.0-beta.4 14,302 11/11/2025
1.0.0-beta.3 288 11/11/2025
1.0.0-beta.2 281 11/11/2025
1.0.0-beta.1 324 11/9/2025