Aspire.Azure.AI.Projects 17.0.0-preview.1.26567.5

Prefix Reserved
This is a prerelease version of Aspire.Azure.AI.Projects.
dotnet add package Aspire.Azure.AI.Projects --version 17.0.0-preview.1.26567.5
                    
NuGet\Install-Package Aspire.Azure.AI.Projects -Version 17.0.0-preview.1.26567.5
                    
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="Aspire.Azure.AI.Projects" Version="17.0.0-preview.1.26567.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Azure.AI.Projects" Version="17.0.0-preview.1.26567.5" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Azure.AI.Projects" />
                    
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 Aspire.Azure.AI.Projects --version 17.0.0-preview.1.26567.5
                    
#r "nuget: Aspire.Azure.AI.Projects, 17.0.0-preview.1.26567.5"
                    
#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 Aspire.Azure.AI.Projects@17.0.0-preview.1.26567.5
                    
#: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=Aspire.Azure.AI.Projects&version=17.0.0-preview.1.26567.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Azure.AI.Projects&version=17.0.0-preview.1.26567.5&prerelease
                    
Install as a Cake Tool

Aspire.Azure.AI.Projects library

Registers an Azure AI Projects AIProjectClient in the DI container as a singleton, with configuration binding, Microsoft Entra authentication, and tracing.

Getting started

Prerequisites

An Azure subscription, a Microsoft Foundry project, and a Microsoft Entra identity with access to the operations you use. Use a project endpoint such as https://account.services.ai.azure.com/api/projects/project, not an Azure OpenAI account endpoint, a Foundry Local endpoint, or a hub-based project's connection string.

Install the package

Install the Aspire Azure AI Projects library with NuGet:

dotnet add package Aspire.Azure.AI.Projects

Usage example

In the consuming application's Program.cs:

builder.AddAzureAIProjectClient("ai");

Supply the connection string through configuration:

{
  "ConnectionStrings": {
    "ai": "Endpoint=https://account.services.ai.azure.com/api/projects/project"
  }
}

A bare project URI is also accepted. Project clients use Microsoft Entra authentication; Key connection strings are rejected rather than silently ignored. By default, Aspire uses a development credential locally and managed identity when deployed to Azure.

Resolve the singleton through dependency injection:

using Azure.AI.Projects;

public class AgentService(AIProjectClient projectClient)
{
    public AIProjectClient ProjectClient => projectClient;
}

The client exposes project connections, deployments, datasets, AgentAdministrationClient, and ProjectOpenAIClient. Refer to the SDK documentation for individual operations and required permissions.

Keyed clients

builder.AddKeyedAzureAIProjectClient("ai");

var client = serviceProvider.GetRequiredKeyedService<AIProjectClient>("ai");

Each key identifies both the connection string and the registered service.

Configuration

Configuration is applied in this order: Aspire:Azure:AI:Projects, its connection-specific subsection, the named connection string, and finally configureSettings. SDK options are bound from the root and connection-specific ClientOptions sections before configureClientBuilder runs.

Use a connection string

Provide ConnectionStrings:ai as shown in the usage example. Both a bare project URI and Endpoint=https://account.services.ai.azure.com/api/projects/project are supported.

Use configuration providers

{
  "Aspire": {
    "Azure": {
      "AI": {
        "Projects": {
          "DisableTracing": false,
          "ai": {
            "Endpoint": "https://account.services.ai.azure.com/api/projects/project",
            "ClientOptions": {
              "NetworkTimeout": "00:01:00"
            }
          }
        }
      }
    }
  }
}

Use inline delegates

Settings and SDK options can also be supplied in code, without a connection string:

using Azure.Identity;
using Microsoft.Extensions.Azure;

builder.AddAzureAIProjectClient("ai",
    configureSettings: settings =>
    {
        settings.Endpoint = new Uri("https://account.services.ai.azure.com/api/projects/project");
        settings.Credential = new AzureCliCredential();
    },
    configureClientBuilder: client => client.ConfigureOptions(options =>
    {
        options.NetworkTimeout = TimeSpan.FromSeconds(60);
    }));

AppHost extensions

Install Aspire.Hosting.Foundry in the AppHost and reference the project from the consuming application:

dotnet add package Aspire.Hosting.Foundry
dotnet add package Aspire.Hosting.Dotnet
var foundry = builder.AddFoundry("foundry");
var project = foundry.AddProject("ai");

builder.AddDotnetProject("app", "../MyApp/MyApp.csproj")
    .WithReference(foundry)
    .WithReference(project);

WithReference(project) supplies the project connection string. The account reference configures runtime identity and Foundry access. Register builder.AddAzureAIProjectClient("ai") in MyApp. Deployment permissions and the application's runtime permissions are distinct; additional operations may require additional roles.

Telemetry and health checks

The integration subscribes to Azure.AI.Projects.* activity sources unless DisableTracing is true. Azure identity logs use the Azure.Identity category. Exporters are configured by the application's service defaults or OpenTelemetry setup.

No metrics or health check is registered. The integration does not perform inference or agent-management requests as a health probe.

Migration

Aspire.Azure.AI.OpenAI and Aspire.Azure.AI.Inference are no longer produced. Previously published versions remain available; this change does not uninstall them or retire the hosting integrations. See microsoft/aspire#20401.

Use this package for project and agent-management operations. For model clients, chat, embeddings, or Responses, use Aspire.Azure.AI.Extensions.OpenAI; its README describes the endpoint, authentication, and API migration. That package also offers AddAzureOpenAIClient for Azure OpenAI accounts with Entra or API-key authentication. Foundry Local continues using Aspire.OpenAI.

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.0.0-preview.1.26567.5 0 11/18/2026