What is Aspire?
Aspire streamlines building, running, debugging, and deploying distributed apps. Picture your app as a set of services, databases, and frontends—when they’re deployed, they all work together seamlessly, but every time you develop them they need to be individually started and connected. With Aspire, you get a unified toolchain that eliminates complex configs and makes local debugging effortless. Instantly launch and debug your entire app with a single command. Ready to deploy? Aspire lets you publish anywhere—Kubernetes, the cloud, or your own servers. It’s also fully extensible, so you can integrate your favorite tools and services with ease.
Why Aspire?
Section titled “Why Aspire?”Building modern applications means juggling multiple services, databases, and dependencies. Here’s what that looks like without Aspire:
The pain of distributed development
Section titled “The pain of distributed development”| Problem | Without Aspire | With Aspire |
|---|---|---|
| Starting services | Open 5 terminals, run 5 different commands, hope they start in the right order | Run aspire run — everything starts automatically. See AppHost overview. |
| Connection strings | Hardcode localhost:5432 everywhere, break production deploys | Service discovery handles it — same code works locally and in production. See Service discovery. |
| ”Works on my machine” | Different team members have different ports, different configs | One AppHost definition, everyone runs the same setup. See First app tutorial. |
| Debugging | Attach debugger to each service individually | Debug your entire stack with a single |
| Finding logs | Check 5 different terminal windows | Aspire Dashboard shows all logs in one place. See Dashboard overview. |
| Adding a database | Install locally, configure connection, hope versions match | builder.AddPostgres("db") — containerized, versioned, consistent. See Integrations. |
Before and after
Section titled “Before and after”Without Aspire, your startup routine might look like:
-
Start the database container
Terminal window docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=secret postgres:15 -
Start the C# API service
Terminal window cd api && dotnet run -
Start the Python worker
Terminal window cd worker && source .venv/bin/activate && python main.py -
Start the JavaScript frontend
Terminal window cd frontend && npm run dev -
Manually verify they can all connect…
Frustration ensues. 🙁
With Aspire, it’s just:
aspire runAnd your AppHost defines everything in type-safe C#—even for polyglot stacks:
var builder = DistributedApplication.CreateBuilder(args);
var db = builder.AddPostgres("db");
var api = builder.AddProject<Projects.Api>("api") .WithReference(db);
var worker = builder.AddPythonApp("worker", "../worker", "main.py") .WithReference(db);
builder.AddNpmApp("frontend", "../frontend") .WithReference(api);
builder.Build().Run();Key benefits
Section titled “Key benefits”- Unified Development Experience: Launch and debug your entire distributed application with a single command.
- Code-First Configuration: Define your app’s architecture in code—no complex config files required.
- Local Orchestration: Automatically handle service startup, dependencies, and connections during development.
- Deployment Flexibility: Deploy to Kubernetes, cloud providers, or your own servers using the same architecture definition.
- Extensible: Integrate with your favorite tools and services through a rich ecosystem of integrations.
How Aspire works
Section titled “How Aspire works”Aspire uses a code-first approach to define your application’s architecture. Instead of managing complex configuration files, you describe your services, databases, and dependencies directly in code. This approach provides several advantages:
- Type Safety: Catch configuration errors at compile time.
- Statement Completion Support: Get code completion and documentation while defining your architecture.
- Version Control: Your infrastructure definition lives alongside your code.
- Refactoring: Use familiar development tools to restructure your application architecture.
Discover how Aspire powers your applications through its
AppHost.
Development vs production
Section titled “Development vs production”Aspire bridges the gap between development and production environments:
- Development: Run services locally with automatic dependency management and service discovery
- Production: Deploy the same architecture definition to various cloud platforms and orchestrators
- Consistency: Ensure your local development environment matches your production topology
Aspire doesn’t replace your existing deployment workflows—it enhances them by providing a consistent way to define and manage your application architecture across environments.
Learn more about Pipelines and App Topology.