.NET Aspire: Control Panel, Observability & IaaC

August 21, 2025 5 mins to read
Share

.NET Aspire: Control Panel, Observability & IaaC

Master .NET Aspire’s three most powerful features for cloud-native development

The Cloud-Native Development Challenges

Building distributed systems traditionally involves complex orchestration and scattered monitoring tools. Here are the three biggest pain points developers face:

❌ Complex Resource Management – Managing multiple services, databases, and message queues requires juggling different tools and interfaces.

❌ Poor Observability – Logs scattered across services, difficult trace correlation, and no unified metrics dashboard.

❌ Infrastructure as Afterthought – Developers focus on code while DevOps handles deployment, creating disconnect and deployment issues.

The Solution: Enter .NET Aspire

.NET Aspire revolutionizes cloud-native development with deployment-first approach that combines development and orchestration:

  • ✅ Built-in Control Panel – Start, stop, and manage all resources from one dashboard
  • ✅ Unified Observability – Logs, traces, and metrics in a single interface
  • ✅ Code-First Infrastructure – Strongly-typed resource configuration with IntelliSense
  • ✅ Dependency Management – Automatic service startup ordering and health checks
  • ✅ Visual Service Graph – See all dependencies and connections at a glance

Three Core Features in Action

Experience .NET Aspire’s power through these three essential capabilities:

🚀 Complete Aspire Setup
# 1. Create new Aspire project
dotnet new aspire

# 2. Add service with dependencies
builder.AddProject<Projects.WebApp>("webapp")
    .WithReference(postgres)
    .WithReference(redis);

# 3. Run with full observability
dotnet run

That’s it! With these steps you get:

  • Automatic resource orchestration
  • Real-time observability dashboard
  • Service dependency management
  • Built-in health monitoring

Feature Deep Dive

1. Control Panel: Resource Orchestration

The Aspire dashboard provides complete control over your distributed system. You can start, stop, and monitor individual services while seeing their real-time status and health.

Key capabilities:

  • Start/stop individual services
  • View service URLs and endpoints
  • Monitor resource health status
  • See service dependencies visually

// Define services in AppHost
var builder = DistributedApplication.CreateBuilder(args);

var postgres = builder.AddPostgres("postgres")
    .WithPgAdmin()
    .AddDatabase("catalogdb");

var redis = builder.AddRedis("redis")
    .WithRedisCommander();

builder.AddProject<Projects.CatalogApi>("catalog-api")
    .WithReference(postgres)
    .WithReference(redis);

2. Observability: Logs, Traces, and Metrics

Get complete visibility into your distributed system without additional setup:

// Automatic OTLP integration
builder.Services.AddOpenTelemetry()
    .WithMetrics(metrics => metrics
        .AddAspNetCoreInstrumentation()
        .AddHttpClientInstrumentation())
    .WithTracing(tracing => tracing
        .AddAspNetCoreInstrumentation()
        .AddHttpClientInstrumentation());

What you get automatically:

  • Structured Logs – Centralized logging from all services
  • Distributed Tracing – Follow requests across service boundaries
  • Performance Metrics – Request duration, error rates, throughput
  • Trace Correlation – See complete request flow with spans

3. Code-First Infrastructure

Define your entire infrastructure using strongly-typed C# code with full IntelliSense support:

// Add Kafka with NuGet integration
// First: dotnet add package Aspire.Hosting.Kafka

var kafka = builder.AddKafka("kafka")
    .WithLifetime(ContainerLifetime.Persistent);

// Use WaitFor to control startup order
builder.AddProject<Projects.OrderProcessor>("order-processor")
    .WithReference(kafka)
    .WaitFor(kafka);  // Ensures Kafka starts first

See It in Action

Once your Aspire application is running, explore these powerful features:

Dashboard Navigation

Access your control panel at the provided URL after running:

dotnet run --project AppHost

Dashboard sections to explore:

  • Resources – All services, databases, and message queues
  • Graph View – Visual dependency relationships
  • Console Logs – Real-time log streaming
  • Traces – Distributed request traces with spans
  • Metrics – Performance KPIs and custom metrics

Advanced Service Dependencies

Demonstrate complex scenarios with dependency injection:

// Complex dependency setup
var builder = DistributedApplication.CreateBuilder(args);

var postgres = builder.AddPostgres("postgres");
var redis = builder.AddRedis("cache");
var rabbitmq = builder.AddRabbitMQ("eventbus");

// API with multiple dependencies
builder.AddProject<Projects.BasketApi>("basket-api")
    .WithReference(postgres)
    .WithReference(redis)
    .WithReference(rabbitmq)
    .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development");

What You’ve Achieved

✅ Unified Development Experience – Build, deploy, and monitor distributed systems from a single interface.

✅ Production-Ready Observability – Get enterprise-grade monitoring without complex setup or additional tools.

✅ Strongly-Typed Infrastructure – Define resources with C# code, getting IntelliSense and compile-time safety.

✅ Simplified Service Dependencies – Automatic service discovery, connection string injection, and startup ordering.

Resources & Code

All code examples and the complete eShop implementation are available in my GitHub repositories:

IggyCloud/eShop

IggyCloud/resources

Next Steps

Now that you understand .NET Aspire’s core features, the next challenges are:

  1. Kubernetes Deployment – Scale beyond local development with production orchestration
  2. Performance Testing – Stress test your distributed system under load
  3. Production Monitoring – Implement comprehensive observability in live environments

Watch the Full Tutorial

🎥 Watch .NET Aspire Deep Dive

Questions about .NET Aspire? Drop a comment below – I respond to every question!

Leave a comment

Your email address will not be published. Required fields are marked *