10 Adding legacy apps to Aspire and working with AI agents
The chapter explains how to bring older Aspire-based systems forward to Aspire 13 and how to add non-Aspire applications into Aspire orchestration without rewriting everything from scratch. It begins by noting that Aspire 8 and 9 systems still exist in the wild, then shows that upgrading is straightforward: Aspire 8 typically requires a manual move to Aspire 9 first, while Aspire 9 can be updated with the Aspire CLI. The goal is to preserve existing behavior while modernizing the project structure, package references, and startup conventions.
It then shifts to enrolling legacy applications into Aspire, emphasizing that Aspire can simplify local development for systems that previously depended on localhost wiring and manual deployment setup. The chapter walks through adding existing projects to an Aspire host, using service defaults, wiring references between services, and exposing health checks so the orchestrator can understand service readiness. It also shows how existing infrastructure like SQL Server can be moved into Aspire as an integration while still preserving a live production database path when needed, using conditional configuration so local runs use Aspire-managed resources and production keeps its external connection.
Finally, the chapter introduces the role of AI coding assistants in making these migrations less tedious. With Aspire’s MCP support, agents like Claude Code can inspect the solution, infer dependencies, suggest an AppHost model, and help implement changes incrementally. The chapter explains that MCP gives agents structured access to repository context, logs, traces, integrations, and app hosts, which helps them make better-informed changes. The core message is that AI can accelerate aspirification, but developers must still review and verify the results carefully before shipping.
A system without Aspire orchestration
A system with the Aspire orchestrator added
Complete aspirified system with intact production database connection
Data from between the agent and the MCP server
Summary
- Upgrading Aspire from versions 8 and 9 to the evergreen version 13 can either be done manually by SDK and package update, or via the aspire CLI tool.
- Aspirification is the process of adding non-Aspire applications to Aspire.
- Aspirification is done by adding the Aspire host, service defaults, and integrating both of these projects with the existing projects.
- Service defaults package doesn’t have to be added to the aspirified system, but it helps, as it comes with healthcheck and metrics.
- The existing connection strings can be left intact for aspirified applications, so they still work with the existing production resources.
- Aspire can be integrated with AI-based coding assistants via MCP and tool calling.
Building Distributed Applications that Work ebook for free