Get started with the Microsoft Foundry integrations
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.
Set up hosting integration
Section titled “Set up hosting integration”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 add foundryThe Aspire CLI is interactive, be sure to select the appropriate search result when prompted:
Select an integration to add:
> foundry (Aspire.Hosting.Foundry)> Other results listed as selectable options...#:package Aspire.Hosting.Foundry@*<PackageReference Include="Aspire.Hosting.Foundry" Version="*" />Next, in the AppHost project, create a Microsoft Foundry resource and pass it to the consuming client projects:
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.
Set up client integration
Section titled “Set up client integration”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.