What Aspire is, the local distributed-development problem it solves, the AppHost and the developer inner loop, the dashboard, and the limits of what Aspire does.
Aspire (called .NET Aspire until version 13 in November 2025) is Microsoft's opinionated stack for building, running and deploying distributed applications. The centre is the AppHost: a C# project where Program.cs describes your app as resources (projects, containers such as SQL Server and Redis, executables) and the references between them.
When you run the AppHost (F5 or aspire run), Aspire starts every resource, injects connection strings and endpoints as environment variables, and opens the dashboard with logs, traces and metrics from every service.
It is not a production runtime: production runs on Container Apps, Kubernetes or App Service, and Aspire generates (and can drive) the deployment. The trade-off is a great inner loop versus one more layer to learn.
"Aspire, which was called .NET Aspire until version 13, is an opinionated stack for building and running distributed .NET applications. The problem it solves is the inner loop. As soon as a system has an API, a worker, a front end, SQL Server, Redis and a message broker, getting it running on a laptop means Docker Compose files, scripts, hard-coded ports and a README that is always out of date. Aspire gives you an AppHost instead: a C# project where I model the app as resources, such as
AddProject,AddSqlServerandAddRedis, and say which ones reference which.When I run the AppHost, Aspire's orchestrator starts every resource, pulls and runs the containers, allocates ports, and injects the connection strings and service endpoints into each project as environment variables, so
builder.Configuration.GetConnectionString("orders")just works. It also opens the dashboard, which receives OpenTelemetry from every service, so I can follow one request from the API through the worker to SQL Server and see where the time went. A shared service defaults project adds OpenTelemetry, health checks, service discovery and HTTP resilience to every service in one line.The mistake I see is treating Aspire as a production platform. It isn't: in production the app runs on Azure Container Apps, AKS or App Service, and Aspire's role there is to generate the deployment artefacts from the same model and, if you want, run the deployment. Aspire makes the system you run locally look like the system you deploy, which is where most of its value comes from."
| Piece | What it is | Why it matters |
|---|---|---|
| AppHost | A C# project (Aspire.AppHost.Sdk) that models resources and references |
The single source of truth for what the app is made of |
| Resources | Projects, containers, executables, cloud resources, parameters | Started and wired by the orchestrator |
| Service defaults | A shared project with AddServiceDefaults() |
Consistent telemetry, health checks, discovery and resilience |
| Integrations | NuGet packages for SQL Server, Redis, PostgreSQL, Service Bus and more | Hosting side (run the resource) and client side (connect to it) |
| Dashboard | Web UI for resources, logs, traces and metrics | Local observability with no extra setup |
| CLI and deployment | aspire run, aspire publish, aspire deploy, or azd |
Turns the same model into Bicep, Compose or Kubernetes output |
| Signal | What you see locally | What it catches before production |
|---|---|---|
| Traces | One waterfall per request across API, worker, Redis and SQL spans | N+1 calls between services, missing caching, slow queries, broken context propagation |
| Structured logs | Logs from every service, filterable and linked to the trace id | Errors in a downstream service you'd otherwise never open |
| Metrics | Request rate, latency histograms, GC and thread-pool counters | Allocation spikes and thread-pool starvation under a quick load test |
Because the same OpenTelemetry set-up is exported to Application Insights or a Collector in production, the instrumentation you check locally is the instrumentation you'll rely on during an incident.
| Task | Without Aspire | With Aspire |
|---|---|---|
| Start the system | Compose up, then run three projects in the right order | Run the AppHost |
| Connection strings | Copied into user secrets on every machine | Injected from the model |
| Service URLs | Hard-coded localhost:5123 |
https+http://catalog via service discovery |
| Telemetry locally | Usually none | Dashboard with traces across services |
| New joiner set-up | Half a day | Clone, install Docker and the SDK, run |
| Fits | Doesn't fit |
|---|---|
| Two or more services plus backing resources | A single API with one database (still useful, but less so) |
| Teams that want the same telemetry set-up everywhere | Teams whose platform team already gives them a full local environment |
| Greenfield .NET 10 work on Azure | Systems where local runs aren't possible (e.g. mainframe dependencies) |
A team with [an API, two workers, SQL Server, Redis and Service Bus] took [about four hours] to onboard a developer, mostly fixing ports and connection strings. After moving the local set-up to an AppHost, a new joiner ran the whole system in [under 15 minutes], and the dashboard's traces exposed an N+1 call between the API and the pricing service that nobody had seen locally before.
Checks that the candidate knows what Aspire actually does, the AppHost model, and that it is a development-time tool rather than a production runtime.
Green flags
Red flags
A microservice or modular system multiplies local set-up work. Every service needs its dependencies running, the right ports and the right configuration, and you can't easily see what happens across service boundaries.
Without Aspire:
docker compose up (sql, redis) -> dotnet run api -> dotnet run worker -> npm run web
+ appsettings.Development.json in each repo with localhost ports
+ no shared telemetry
With Aspire:
aspire run (or F5 on the AppHost)
|
+-- DCP orchestrator starts: sql (container), redis (container), api, worker, web
+-- injects env vars: ConnectionStrings__orders, services__api__https__0, OTEL_*
+-- dashboard on https://localhost:<port> receives OTLP from everything
The AppHost builds a graph of resources. Each resource has a name, endpoints, environment variables and annotations. WithReference(x) adds an edge: "this resource needs x", which becomes environment variables in the consumer. WaitFor(x) delays start until x is healthy. Nothing about this is magic: it is a DSL over environment variables and process/container start-up.
The AppHost hands the model to the Developer Control Plane (DCP), a Kubernetes-style orchestrator that runs on your machine. DCP launches .NET projects as processes and containers through Docker or Podman, and watches them. That is why Docker (or Podman) is a prerequisite.
Each service calls AddServiceDefaults(), which configures OpenTelemetry logging, tracing and metrics with an OTLP exporter. The AppHost sets OTEL_EXPORTER_OTLP_ENDPOINT to the dashboard, so traces show up with no code beyond that call.
The same model is used to generate deployment output. aspire publish writes artefacts (Bicep for Azure Container Apps, Docker Compose files, or Kubernetes/Helm output, depending on the environment you add), and aspire deploy or azd up provisions and deploys them. Production runs on that platform, not on Aspire.
aspire new, aspire run, aspire add, aspire publish, aspire deploy) is now the main entry point, alongside Visual Studio and VS Code.aspire new aspire-starter; run it and open the dashboard.aspire add redis, reference it from the API, and find the injected ConnectionStrings__cache on the resource's details page.aspire publish and read the generated output to see how the model becomes deployment artefacts.A minimal AppHost: one API, one worker, SQL Server and Redis, with references and start-up ordering.
// AppHost/Program.cs
var builder = DistributedApplication.CreateBuilder(args);
// Backing resources run as containers locally.
var sql = builder.AddSqlServer("sql")
.WithDataVolume(); // keep data between runs
var ordersDb = sql.AddDatabase("orders");
var cache = builder.AddRedis("cache");
// Projects: references become env vars (connection strings, endpoints).
var api = builder.AddProject<Projects.Orders_Api>("api")
.WithReference(ordersDb).WaitFor(ordersDb)
.WithReference(cache);
builder.AddProject<Projects.Orders_Worker>("worker")
.WithReference(ordersDb).WaitFor(ordersDb)
.WithReference(api); // enables http://api via service discovery
builder.Build().Run();
// Orders.Api/Program.cs: the service just reads normal configuration.
var builder = WebApplication.CreateBuilder(args);
builder.AddServiceDefaults(); // OTel, health, discovery, resilience
builder.AddSqlServerDbContext<OrdersDbContext>("orders"); // client integration reads ConnectionStrings:orders
builder.AddRedisDistributedCache("cache");
var app = builder.Build();
app.MapDefaultEndpoints(); // /health and /alive (Development by default)
app.MapGet("/orders/{id:int}", async (int id, OrdersDbContext db, CancellationToken ct) =>
await db.Orders.FindAsync([id], ct) is { } o ? Results.Ok(o) : Results.NotFound());
app.Run();
GetConnectionString("orders") or a client integration, validate required settings at start-up with ValidateOnStart, and keep real secrets in user secrets locally and Key Vault when deployed.AddServiceDefaults() in a new service. Why it is wrong: That service sends no telemetry and has no health endpoints, so it is invisible on the dashboard and in production monitoring. Instead: Reference the service defaults project from every service, and check for it in code review.aspire CLI, aspire deploy).Aspire's real value is consistency: the same model drives local runs, tests and deployment, and every service gets the same telemetry and health set-up. I judge it by onboarding time and how quickly people can follow a request across services, not by how clever the AppHost is.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Aspire AppHost | .NET-heavy systems with several services and resources | Learning the model; keeping packages current | One small service with no dependencies |
| Docker Compose | Polyglot teams, or production also uses Compose | YAML drift; no telemetry by default | When you want typed references and a dashboard |
| Scripts + README | Throwaway prototypes | Breaks silently as the system grows | Anything a team maintains |
| Remote dev environments | Systems too big for a laptop | Cloud cost; network dependency | Small systems |
The AppHost's Program.cs creates a DistributedApplication builder, adds resources, links them and runs:
AddProject<Projects.Orders_Api>("api") adds a project; the name becomes its service-discovery name.AddSqlServer("sql").AddDatabase("orders") and AddRedis("cache") run containers locally; the resource name is the connection-string name.WithReference(db) injects ConnectionStrings__orders; WithReference(api) injects services__api__https__0, the endpoint.WaitFor(db) holds start-up until the database is healthy.Add WithDataVolume() to keep data, ContainerLifetime.Persistent to avoid restarting slow containers, and AddParameter(..., secret: true) for passwords. The trade-off: references are simple, but every name is a contract between the AppHost and the service's configuration.
Docker Compose describes a multi-container app in a compose.yaml: each service (the API, mcr.microsoft.com/mssql/server, redis) gets an image or build context, ports, environment variables and volumes. docker compose up starts them on a shared network where they find each other by service name, so the API connects to Server=sqlserver,1433.
I add a health check to SQL Server and depends_on: condition: service_healthy to the API, because SQL Server takes several seconds to accept logins. A named volume keeps the data between runs.
It is for local development and CI, not production. In a .NET-only solution, .NET Aspire does the same orchestration in C# with dashboards, and Testcontainers is better for integration tests.
Distributed tracing records the path of one request through every service it touches. A trace is the whole operation; a span is one timed piece of work inside it, such as an incoming HTTP request, a SQL query or a Service Bus send. Every span in a trace shares a trace id (16 bytes, written as 32 hex characters), has its own span id (8 bytes, 16 hex characters), and points to its parent span id, so the spans form a tree you can view as a waterfall.
The ids travel between services in the W3C traceparent header, with optional vendor-specific data in tracestate. In .NET a span is a System.Diagnostics.Activity, and OpenTelemetry exports it.
Logs alone tell you what happened in each service, but not which call caused which or where the 2 seconds went. Traces give you causality and timing; logs give you detail. The trade-off is volume: traces are expensive, so you sample them.
Last updated 23 Nov 2026.