Skip to content

.NET Aspire Integrations

.NET Aspire Integrations

.NET Aspire Integrations are pre-built packages that simplify connecting your cloud-native applications to popular services and platforms. These integrations provide standardized configuration, health checks, telemetry, and resilience patterns out of the box.

Key Features

  • Standardized Configuration: Consistent configuration patterns across different services
  • Built-in Health Checks: Automatic health monitoring for connected services
  • Observability: Integrated logging, metrics, and distributed tracing
  • Resilience: Built-in retry policies, circuit breakers, and timeout handling
  • Service Discovery: Automatic service registration and discovery capabilities

Available Integrations

Database Integrations

  • SQL Server: Entity Framework Core with SQL Server
  • PostgreSQL: Npgsql and Entity Framework Core support
  • MySQL: MySqlConnector and Entity Framework Core
  • MongoDB: MongoDB.Driver integration
  • Redis: StackExchange.Redis for caching and pub/sub

Message Brokers

  • Azure Service Bus: Full-featured message broker integration
  • RabbitMQ: AMQP messaging support
  • Apache Kafka: Distributed event streaming

Cloud Services

  • Azure Storage: Blob, Queue, and Table storage
  • Azure Key Vault: Secure secret management
  • Azure Cosmos DB: NoSQL database integration

Observability

  • OpenTelemetry: Distributed tracing and metrics
  • Prometheus: Metrics collection and monitoring
  • Jaeger: Distributed tracing visualization

Usage Pattern

Integrations are typically added to your project using the AddServiceDefaults() extension method and configured through the app host project for orchestration and service-to-service communication.

Aspire Integrations

Aspire provides two main types of integrations to simplify working with external services and dependencies:

Hosting Integrations

Hosting integrations are used in the AppHost project to define and configure external resources that your application depends on. These integrations:

  • Define containerized services (databases, message brokers, caches, etc.)
  • Configure connection strings and service discovery
  • Set up dependencies between services
  • Handle resource lifecycle management during development
  • Enable easy scaling and orchestration of services

Common hosting integrations include Redis, PostgreSQL, SQL Server, RabbitMQ, and MongoDB.

Client Integrations

Client integrations are used in your service projects to connect to and interact with the resources defined by hosting integrations. These integrations:

  • Provide pre-configured clients for external services
  • Handle connection string resolution automatically
  • Include health checks and telemetry out of the box
  • Follow .NET dependency injection patterns
  • Implement retry policies and resilience patterns

Client integrations ensure your services can easily connect to the resources orchestrated by the AppHost with minimal configuration (so for example your API can use a database defined in the hosting integrations).