Skip to content
Docs Try Aspire

Get started with the Microsoft Foundry integrations

Microsoft Foundry logo 🧪 Preview

Microsoft Foundry provides a unified platform for developing, testing, and deploying AI applications. The Aspire Microsoft Foundry integration enables you to connect to Microsoft Foundry services from your applications, providing access to various AI capabilities including model deployments, prompt flow, and more.

In this introduction, you’ll see how to install and use the Aspire Microsoft Foundry integrations in a simple configuration. If you already have this knowledge, see Microsoft Foundry Hosting integration for full reference details.

To begin, install the Aspire Microsoft Foundry Hosting integration in your Aspire AppHost project. This integration allows you to create and manage Microsoft Foundry resources from your Aspire hosting projects:

Aspire CLI — Add Aspire.Hosting.Foundry package
aspire add foundry

The Aspire CLI is interactive, be sure to select the appropriate search result when prompted:

Aspire CLI — Example output prompt
Select an integration to add:
> foundry (Aspire.Hosting.Foundry)
> Other results listed as selectable options...

Next, in the AppHost project, create a Microsoft Foundry resource and pass it to the consuming client projects:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var foundry = builder.AddFoundry("foundry");
var chat = foundry.AddDeployment("chat", FoundryModel.OpenAI.Gpt5Mini);
builder.AddProject<Projects.ExampleProject>()
.WithReference(chat)
.WaitFor(chat);
// After adding all resources, run the app...
builder.Build().Run();

The preceding code adds a Microsoft Foundry resource named foundry with a deployment named chat using the generated FoundryModel.OpenAI.Gpt5Mini descriptor. The WithReference method passes the connection information to the ExampleProject project.

The client integration for Azure AI Foundry is the Azure AI Inference integration. To use Azure AI Foundry from your client applications, install the Azure AI Inference integration in your client project.

For more information on using the client integration, see the Azure AI Inference integration documentation.