Edit

Share via


Aspire integrations overview

Aspire integrations are a curated suite of NuGet packages selected to facilitate the integration of cloud-native applications with prominent services and platforms, such as Redis and PostgreSQL. Each integration furnishes essential cloud-native functionalities through either automatic provisioning or standardized configuration patterns.

Tip

Always strive to use the latest version of Aspire integrations to take advantage of the latest features, improvements, and security updates.

Warning

Integrations execute code in your development environment. Ensure that third-party integrations are trusted before use. For more information, see Best practices for a secure software supply chain.

Integration responsibilities

Most Aspire integrations are made up of two separate libraries, each with a different responsibility. One type represents resources within the AppHost projectβ€”known as hosting integrations. The other type of integration represents client libraries that connect to the resources modeled by hosting integrations, and they're known as client integrations.

Hosting integrations

Hosting integrations configure applications by provisioning resources (like containers or cloud resources) or pointing to existing instances (such as a local SQL server). These packages model various services, platforms, or capabilities, including caches, databases, logging, storage, and messaging systems.

Hosting integrations extend the IDistributedApplicationBuilder interface, enabling the AppHost project to express resources within its app model. Hosting integrations work with any type of application, not just .NET applications. They provide infrastructure and inject configuration details (such as connection strings, endpoints, and credentials) as environment variables into any project, executable, or container that references them.

The official hosting integration NuGet packages are tagged with aspire, integration, and hosting. In addition to the official hosting integrations, the community has created hosting integrations for various services and platforms as part of the Community Toolkit.

For information on creating a custom hosting integration, see Create custom Aspire hosting integration.

Client integrations

Client integrations wire up client libraries to dependency injection (DI), define configuration schema, and add health checks, resiliency, and telemetry where applicable. Aspire client integration libraries are prefixed with Aspire. and then include the full package name that they integrate with, such as Aspire.StackExchange.Redis.

These packages configure existing client libraries to connect to hosting integrations. They extend the IHostApplicationBuilder interface allowing client-consuming projects, such as your web app or API, to use the connected resource. The official client integration NuGet packages are tagged with aspire, integration, and client. In addition to the official client integrations, the community has created client integrations for various services and platforms as part of the Community Toolkit.

Important

Aspire integrations require IHostApplicationBuilder and are not compatible with HostingStartup implementations, which only provide access to IWebHostBuilder. If you're using HostingStartup for modular configuration, see HostingStartup is not supported with Aspire integrations for migration guidance.

For more information on creating a custom client integration, see Create custom Aspire client integrations.

Relationship between hosting and client integrations

Hosting and client integrations are best when used together, but are not coupled and can be used separately. Some hosting integrations don't have a corresponding client integration. Configuration is what makes the hosting integration work with the client integration.

Client integrations are .NET-specific and provide convenient, opinionated ways to configure .NET applications. However, you can use hosting integrations without client integrations for non-.NET applications or when you prefer to configure connections manually. In these scenarios, the hosting integration still provides the infrastructure and exposes connection information through environment variables that any application technology can consume.

Consider the following diagram that depicts the relationship between hosting and client integrations:

A diagram

The AppHost project is where hosting integrations are used. Configuration, specifically environment variables, is injected into projects, executables, and containers, allowing client integrations to connect to the hosting integrations.

Integration features

When you add a client integration to a project within your Aspire solution, service defaults are automatically applied to that project; meaning the Service Defaults project is referenced and the AddServiceDefaults extension method is called. These defaults are designed to work well in most scenarios and can be customized as needed. The following service defaults are applied:

  • Observability and telemetry: Automatically sets up logging, tracing, and metrics configurations:

    • Logging: A technique where code is instrumented to produce logs of interesting events that occurred while the program was running.
    • Tracing: A specialized form of logging that helps you localize failures and performance issues within applications distributed across multiple machines or processes.
    • Metrics: Numerical measurements recorded over time to monitor application performance and health. Metrics are often used to generate alerts when potential problems are detected.
  • Health checks: Exposes HTTP endpoints to provide basic availability and state information about an app. Health checks are used to influence decisions made by container orchestrators, load balancers, API gateways, and other management services.

  • Resiliency: The ability of your system to react to failure and still remain functional. Resiliency extends beyond preventing failures to include recovering and reconstructing your cloud-native environment back to a healthy state.

Understand host integration extension methods

Aspire hosting integrations provide extension methods that start with either Add or With. These methods conform to the following pattern:

  • Add* methods: Add* methods create and register new resources within the AppHost and return an IResourceBuilder<TResource> where TResource is the concrete resource type added. This lets you continue fluent configuration on the returned builder. For example, calling AddAzureServiceBus returns an IResourceBuilder<AzureServiceBusResource>, and then calling AddServiceBusQueue on that namespace builder returns an IResourceBuilder<AzureServiceBusQueueResource>. This pattern models parent-child relationships (for example, a Service Bus namespace and its queues or topics) while preserving a consistent fluent builder API.
  • With* methods: Use With* methods to configure or enhance an existing resource. These methods typically return the same object type as the parent, allowing you to chain additional configuration calls.

Important

When using Add methods, make sure to pass the correct resource object to your client integration. Passing the wrong object can result in misconfigured connections or runtime errors.

Consider this code:

var serviceBus = builder.AddAzureServiceBus(name: "serviceBus")
    .AddServiceBusTopic(name: "messagetopic");

var apiService = builder.AddProject<Projects.servicebusexp_ApiService>("apiservice")
    .WithHttpHealthCheck("/health")
    .WithReference(serviceBus);

// The serviceBus is an IResourceBuilder<AzureServiceBusTopicResource> type

You may expect serviceBus to represent the Azure Service Bus resource but in fact, because you called AddServiceBusTopic on the same line, serviceBus is an Azure Service Bus topic resource. To avoid this result, call AddServiceBusTopic on a separate line:

var serviceBus = builder.AddAzureServiceBus(name: "serviceBus");
var topic = serviceBus.AddServiceBusTopic(name: "messagetopic");

var apiService = builder.AddProject<Projects.servicebusexp_ApiService>("apiservice")
    .WithHttpHealthCheck("/health")
    .WithReference(serviceBus);

// The serviceBus is an IResourceBuilder<AzureServiceBusResource> type

Now, you can choose to pass the resource that consuming project needs. Either, as in the example, the Service Bus resource or the topic resource.

This distinction helps you model your application's infrastructure accurately and ensures that client integrations receive the correct connection information.

Versioning considerations

Hosting and client integrations are updated each release to target the latest stable versions of dependent resources. When container images are updated with new image versions, the hosting integrations update to these new versions. Similarly, when a new NuGet version is available for a dependent client library, the corresponding client integration updates to the new version. This ensures the latest features and security updates are available to applications. The Aspire update type (major, minor, patch) doesn't necessarily indicate the type of update in dependent resources. For example, a new major version of a dependent resource may be updated in an Aspire patch release, if necessary.

When major breaking changes happen in dependent resources, integrations may temporarily split into version-dependent packages to ease updating across the breaking change. For more information, see the first example of such a breaking change.

Official integrations

Aspire provides many integrations to help you build cloud-native applications. These integrations are designed to work seamlessly with the Aspire AppHost and client libraries. The following sections detail cloud-agnostic, Azure-specific, Amazon Web Services (AWS), and Community Toolkit integrations.

Cloud-agnostic integrations

The following section details cloud-agnostic Aspire integrations with links to their respective docs and NuGet packages, and provides a brief description of each integration.

Integration docs and NuGet packages Description
- Learn more: πŸ“„ Apache Kafka
- Hosting: πŸ“¦ Aspire.Hosting.Kafka
- Client: πŸ“¦ Aspire.Confluent.Kafka
A library for producing and consuming messages from an Apache Kafka broker.
- Learn more: πŸ“„ Dapr
- Hosting: πŸ“¦ Aspire.Hosting.Dapr
- Client: N/A
A library for modeling Dapr as an Aspire resource.
- Learn more: πŸ“„ Docker
- Hosting: πŸ“¦ Aspire.Hosting.Docker
- Client: N/A
A library for deploying Aspire applications using Docker Compose.
- Learn more: πŸ“„ Elasticsearch
- Hosting: πŸ“¦ Aspire.Hosting.Elasticsearch
- Client: πŸ“¦ Aspire.Elastic.Clients.Elasticsearch
A library for accessing Elasticsearch databases.
- Learn more: πŸ“„ Keycloak
- Hosting: πŸ“¦ Aspire.Hosting.Keycloak
- Client: πŸ“¦ Aspire.Keycloak.Authentication
A library for accessing Keycloak authentication.
- Learn more: πŸ“„ Milvus
- Hosting: πŸ“¦ Aspire.Hosting.Milvus
- Client: πŸ“¦ Aspire.Milvus.Client
A library for accessing Milvus databases.
- Learn more: πŸ“„ MongoDB Driver
- Hosting: πŸ“¦ Aspire.Hosting.MongoDB
- Client: πŸ“¦ Aspire.MongoDB.Driver
A library for accessing MongoDB databases.
- Learn more: πŸ“„ MySqlConnector
- Hosting: πŸ“¦ Aspire.Hosting.MySql
- Client: πŸ“¦ Aspire.MySqlConnector
A library for accessing MySqlConnector databases.
- Learn more: πŸ“„ NATS
- Hosting: πŸ“¦ Aspire.Hosting.Nats
- Client: πŸ“¦ Aspire.NATS.Net
A library for accessing NATS messaging.
- Learn more: πŸ“„ Oracle - EF Core
- Hosting: πŸ“¦ Aspire.Hosting.Oracle
- Client: πŸ“¦ Aspire.Oracle.EntityFrameworkCore
A library for accessing Oracle databases with Entity Framework Core.
- Learn more: πŸ“„ OpenAI
- Hosting: πŸ“¦ Aspire.Hosting.OpenAI
- Client: πŸ“¦ Aspire.OpenAI
A library for accessing OpenAI APIs.
- Learn more: πŸ“„ Orleans
- Hosting: πŸ“¦ Aspire.Hosting.Orleans
- Client: N/A
A library for modeling Orleans as an Aspire resource.
- Learn more: πŸ“„ Pomelo MySQL - EF Core
- Hosting: πŸ“¦ Aspire.Hosting.MySql
- Client: πŸ“¦ Aspire.Pomelo.EntityFrameworkCore.MySql
A library for accessing MySql databases with Entity Framework Core.
- Learn more: πŸ“„ PostgreSQL - EF Core
- Hosting: πŸ“¦ Aspire.Hosting.PostgreSQL
- Client: πŸ“¦ Aspire.Npgsql.EntityFrameworkCore.PostgreSQL
A library for accessing PostgreSQL databases using Entity Framework Core.
- Learn more: πŸ“„ PostgreSQL
- Hosting: πŸ“¦ Aspire.Hosting.PostgreSQL
- Client: πŸ“¦ Aspire.Npgsql
A library for accessing PostgreSQL databases.
- Learn more: πŸ“„ Qdrant
- Hosting: πŸ“¦ Aspire.Hosting.Qdrant
- Client: πŸ“¦ Aspire.Qdrant.Client
A library for accessing Qdrant databases.
- Learn more: πŸ“„ RabbitMQ
- Hosting: πŸ“¦ Aspire.Hosting.RabbitMQ
- Client: πŸ“¦ Aspire.RabbitMQ.Client
A library for accessing RabbitMQ.
- Learn more: πŸ“„ Redis Distributed Caching
- Hosting: πŸ“¦ Aspire.Hosting.Redis, πŸ“¦ Aspire.Hosting.Garnet, or πŸ“¦ Aspire.Hosting.Valkey
- Client: πŸ“¦ Aspire.StackExchange.Redis.DistributedCaching
A library for accessing Redis caches for distributed caching.
- Learn more: πŸ“„ Redis Output Caching
- Hosting: πŸ“¦ Aspire.Hosting.Redis, πŸ“¦ Aspire.Hosting.Garnet, or πŸ“¦ Aspire.Hosting.Valkey
- Client: πŸ“¦ Aspire.StackExchange.Redis.OutputCaching
A library for accessing Redis caches for output caching.
- Learn more: πŸ“„ Redis
- Hosting: πŸ“¦ Aspire.Hosting.Redis, πŸ“¦ Aspire.Hosting.Garnet, or πŸ“¦ Aspire.Hosting.Valkey
- Client: πŸ“¦ Aspire.StackExchange.Redis
A library for accessing Redis caches.
- Learn more: πŸ“„ Seq
- Hosting: πŸ“¦ Aspire.Hosting.Seq
- Client: πŸ“¦ Aspire.Seq
A library for logging to Seq.
- Learn more: πŸ“„ SQL Server - EF Core
- Hosting: πŸ“¦ Aspire.Hosting.SqlServer
- Client: πŸ“¦ Aspire.Microsoft.EntityFrameworkCore.SqlServer
A library for accessing SQL Server databases using EF Core.
- Learn more: πŸ“„ SQL Server
- Hosting: πŸ“¦ Aspire.Hosting.SqlServer
- Client: πŸ“¦ Aspire.Microsoft.Data.SqlClient
A library for accessing SQL Server databases.

For more information on working with Aspire integrations in Visual Studio, see Visual Studio tooling.

Azure integrations

Azure integrations configure applications to use Azure resources. These hosting integrations are available in the Aspire.Hosting.Azure.* NuGet packages, while their client integrations are available in the Aspire.* NuGet packages:

Integration Docs and NuGet packages Description
Azure App Configuration logo. - Learn more: πŸ“„ Azure App Configuration
- Hosting: πŸ“¦ Aspire.Hosting.Azure.AppConfiguration
- Client: N/A
A library for interacting with Azure App Configuration.
Azure App Service logo. - Learn more: πŸ“„ Azure App Service
- Hosting: πŸ“¦ Aspire.Hosting.Azure.AppService
- Client: N/A
A library for hosting web applications on Azure App Service.
Azure Application Insights logo. - Learn more: πŸ“„ Azure Application Insights
- Hosting: πŸ“¦ Aspire.Hosting.Azure.ApplicationInsights
- Client: N/A
A library for interacting with Azure Application Insights.
Azure Cache for Redis logo - Learn more: πŸ“„ Azure Cache for Redis
- Hosting: πŸ“¦ Aspire.Hosting.Azure.Redis
- Client: πŸ“¦ Aspire.StackExchange.Redis or πŸ“¦ Aspire.StackExchange.Redis.DistributedCaching or πŸ“¦ Aspire.StackExchange.Redis.OutputCaching
A library for accessing Azure Cache for Redis.
Azure Cosmos DB EF logo. - Learn more: πŸ“„ Azure Cosmos DB - EF Core
- Hosting: πŸ“¦ Aspire.Hosting.Azure.CosmosDB
- Client: πŸ“¦ Aspire.Microsoft.EntityFrameworkCore.Cosmos
A library for accessing Azure Cosmos DB databases with Entity Framework Core.
Azure Cosmos DB logo. - Learn more: πŸ“„ Azure Cosmos DB
- Hosting: πŸ“¦ Aspire.Hosting.Azure.CosmosDB
- Client: πŸ“¦ Aspire.Microsoft.Azure.Cosmos
A library for accessing Azure Cosmos DB databases.
Azure Event Hubs logo. - Learn more: πŸ“„ Azure Event Hubs
- Hosting: πŸ“¦ Aspire.Hosting.Azure.EventHubs
- Client: πŸ“¦ Aspire.Azure.Messaging.EventHubs
A library for accessing Azure Event Hubs.
Azure Functions logo. - Learn more: πŸ“„ Azure Functions
- Hosting: πŸ“¦ Aspire.Hosting.Azure.Functions
- Client: N/A
A library for integrating with Azure Functions.
Azure Key Vault logo. - Learn more: πŸ“„ Azure Key Vault
- Hosting: πŸ“¦ Aspire.Hosting.Azure.KeyVault
- Client: πŸ“¦ Aspire.Azure.Security.KeyVault
A library for accessing Azure Key Vault.
Azure Operational Insights logo. - Learn more: πŸ“„ Azure Operational Insights
- Hosting: πŸ“¦ Aspire.Hosting.Azure.OperationalInsights
- Client: N/A
A library for interacting with Azure Operational Insights.
Azure OpenAI logo. - Learn more: πŸ“„ Azure AI OpenAI
- Hosting: πŸ“¦ Aspire.Hosting.Azure.CognitiveServices
- Client: πŸ“¦ Aspire.Azure.AI.OpenAI
A library for accessing Azure AI OpenAI or OpenAI functionality.
Azure PostgreSQL logo. - Learn more: πŸ“„ Azure PostgreSQL
- Hosting: πŸ“¦ Aspire.Hosting.Azure.PostgreSQL
- Client: N/A
A library for interacting with Azure Database for PostgreSQL.
Azure AI Search logo. - Learn more: πŸ“„ Azure AI Search
- Hosting: πŸ“¦ Aspire.Hosting.Azure.Search
- Client: πŸ“¦ Aspire.Azure.Search.Documents
A library for accessing Azure AI Search functionality.
Azure Service Bus logo. - Learn more: πŸ“„ Azure Service Bus
- Hosting: πŸ“¦ Aspire.Hosting.Azure.ServiceBus
- Client: πŸ“¦ Aspire.Azure.Messaging.ServiceBus
A library for accessing Azure Service Bus.
Azure SignalR Service logo. - Learn more: πŸ“„ Azure SignalR Service
- Hosting: πŸ“¦ Aspire.Hosting.Azure.SignalR
- Client: Microsoft.Azure.SignalR
A library for accessing Azure SignalR Service.
Azure Blob Storage logo. - Learn more: πŸ“„ Azure Blob Storage
- Hosting: πŸ“¦ Aspire.Hosting.Azure.Storage
- Client: πŸ“¦ Aspire.Azure.Storage.Blobs
A library for accessing Azure Blob Storage.
Azure Storage Queues logo. - Learn more: πŸ“„ Azure Storage Queues
- Hosting: πŸ“¦ Aspire.Hosting.Azure.Storage
- Client: πŸ“¦ Aspire.Azure.Storage.Queues
A library for accessing Azure Storage Queues.
Azure Table Storage logo. - Learn more: πŸ“„ Azure Table Storage
- Hosting: πŸ“¦ Aspire.Hosting.Azure.Storage
- Client: πŸ“¦ Aspire.Azure.Data.Tables
A library for accessing the Azure Table service.
Azure Web PubSub logo. - Learn more: πŸ“„ Azure Web PubSub
- Hosting: πŸ“¦ Aspire.Hosting.Azure.WebPubSub
- Client: πŸ“¦ Aspire.Azure.Messaging.WebPubSub
A library for accessing the Azure Web PubSub service.

Amazon Web Services (AWS) hosting integrations

Integration docs and NuGet packages Description
- Learn more: πŸ“„ AWS Hosting
- Hosting: πŸ“¦ Aspire.Hosting.AWS
- Client: N/A
A library for modeling AWS resources.

For more information, see GitHub: Aspire.Hosting.AWS library.

Kubernetes hosting integrations

Integration docs and NuGet packages Description
- Learn more: πŸ“„ Kubernetes hosting
- Hosting: πŸ“¦ Aspire.Hosting.Kubernetes
- Client: N/A
A library for generating Kubernetes deployment manifests from your .NET Aspire application model.

Community Toolkit integrations

Note

The Community Toolkit integrations are community-driven and maintained by the Aspire community. These integrations are not officially supported by the Aspire team.

Integration docs and NuGet packages Description
- Learn More: πŸ“„ Bun hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Bun
- Client: N/A
A hosting integration for Bun apps.
- Learn More: πŸ“„ Deno hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Deno
- Client: N/A
A hosting integration for Deno apps.
- Learn More: πŸ“„ Go hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Golang
- Client: N/A
A hosting integration for Go apps.
- Learn More: πŸ“„ Java/Spring hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Java
- Client: N/A
A integration for running Java code in Aspire either using the local JDK or using a container.
- Learn More: πŸ“„ Node.js hosting extensions
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.NodeJs.Extensions
- Client: N/A
An integration that contains some additional extensions for running Node.js applications
- Learn More: πŸ“„ Ollama
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Ollama
- Client: πŸ“¦ Aspire.CommunitToolkit.OllamaSharp
An Aspire component leveraging the Ollama container with support for downloading a model on startup.
- Learn More: πŸ“„ Meilisearch hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Meilisearch
- Client: πŸ“¦ Aspire.CommunitToolkit.Meilisearch
An Aspire component leveraging the Meilisearch container.
- Learn More: πŸ“„ Rust hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.Rust
- Client: N/A
A hosting integration for Rust apps.
- Learn More: πŸ“„ SQL Database projects hosting
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects
- Client: N/A
An Aspire hosting integration for SQL Database Projects.
- Learn More: πŸ“„ RavenDB
- Hosting: πŸ“¦ CommunityToolkit.Aspire.Hosting.RavenDB
- Client: πŸ“¦ Aspire.CommunityToolkit.RavenDB.Client
An Aspire component leveraging the RavenDB container.

For more information, see Aspire Community Toolkit.