dotnet-aspire

v2026.09.25

.NET Aspire for cloud-native app orchestration, service discovery, telemetry, and component integrations

GitHub
Install command
npx skhub add thelobbi/dotnet-aspire
Markdown
SKILL.md

.NET Aspire

What is Aspire?

.NET Aspire is an opinionated, cloud-ready stack for building observable, production-ready, distributed applications. It provides:

  • Orchestration - Coordinate multi-service apps with AppHost
  • Components - Pre-configured NuGet packages for common services (Redis, PostgreSQL, RabbitMQ, etc.)
  • Tooling - Dashboard for logs, traces, metrics; CLI for management
  • Service Defaults - Shared configuration for health checks, telemetry, resilience

AppHost (Orchestrator)

// MyApp.AppHost/Program.cs
var builder = DistributedApplication.CreateBuilder(args);

// Infrastructure resources
var postgres = builder.AddPostgres("postgres").WithDataVolume().WithPgAdmin();
var redis = builder.AddRedis("redis").WithRedisInsight();
var rabbitmq = builder.AddRabbitMQ("messaging").WithManagementPlugin();

// Databases
var appDb = postgres.AddDatabase("appdb");

// Projects (services)
var api = builder.AddProject<Projects.Api>("api")
    .WithReference(appDb)
    .WithReference(redis)
    .WithReference(rabbitmq)
    .WithExternalHttpEndpoints();

var web = builder.AddProject<Projects.Web>("web")
    .WithReference(api)
    .WithReference(redis)
    .WithExternalHttpEndpoints();

var worker = builder.AddProject<Projects.Worker>("worker")
    .WithReference(rabbitmq)
    .WithReference(appDb);

builder.Build().Run();

Service Defaults

// ServiceDefaults/Extensions.cs (shared project)
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder)
{
    builder.ConfigureOpenTelemetry();
    builder.AddDefaultHealthChecks();
    builder.Services.AddServiceDiscovery();

    builder.Services.ConfigureHttpClientDefaults(http =>
    {
        http.AddStandardResilienceHandler();
        http.AddServiceDiscovery();
    });

    return builder;
}

Component Integrations

ComponentNuGet PackageAddXxx Method
PostgreSQL (EF)Aspire.Npgsql.EntityFrameworkCore.PostgreSQLAddNpgsqlDbContext<T>()
SQL Server (EF)Aspire.Microsoft.EntityFrameworkCore.SqlServerAddSqlServerDbContext<T>()
Redis CacheAspire.StackExchange.Redis.DistributedCachingAddRedisDistributedCache()
Redis Output CacheAspire.StackExchange.Redis.OutputCachingAddRedisOutputCache()
RabbitMQAspire.RabbitMQ.ClientAddRabbitMQClient()
Azure Service BusAspire.Azure.Messaging.ServiceBusAddAzureServiceBusClient()
Azure Blob StorageAspire.Azure.Storage.BlobsAddAzureBlobClient()
Cosmos DBAspire.Microsoft.Azure.CosmosAddAzureCosmosClient()

Dashboard

The Aspire dashboard provides:

  • Structured logs from all services
  • Distributed traces across service boundaries
  • Metrics (request rates, latencies, error rates)
  • Resource status and health checks

Access at: https://localhost:18888 (default)

Deployment

# Deploy to Azure Container Apps
azd init
azd provision  # Creates Azure resources
azd deploy     # Deploys all services

# Or use Aspire CLI
aspire publish --publisher azure

Key Patterns

  • Every service project calls builder.AddServiceDefaults()
  • Use WithReference() to establish service dependencies
  • Use WithExternalHttpEndpoints() for publicly accessible services
  • Service discovery uses https+http://service-name URIs
  • All telemetry is automatically correlated across services
Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.25

Published

Sep 25, 2026

Category

Uncategorized

License

MIT

Source path

plugins/dotnet-blazor/skills/dotnet-aspire

Default branch

main

Latest commit

2f1269c

Tree SHA

629e050