dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.83k stars 457 forks source link

How can App Host reference microservice projects across multiple repos? #895

Closed julioct closed 11 months ago

julioct commented 11 months ago

In a true microservices-based system, each microservice has its own code base and lives in its own repo. This is also true for the frontend and inspired by the popular Twelve-Factor App.

However, the App Host project requires project references to each of the microservices that it will host, which is not possible if those live in other repos:

var apiservice = builder.AddProject<Projects.AspireApp_ApiService>("apiservice");

Sadly that kind of thing would not make sense in a real microservices-based system where you have dozens of repos, each one dedicated to one, and only one microservice.

Ideally, I would spin up a new repo that would have only my App Host and Service Defaults project, and the App Host project there would still be able to discover and host all my microservices.

How to achieve this?

P.S The fact that the eShop project lives in a single repo is a bad practice, even when it shows great patterns for implementing microservices (and seems to make use of Aspire).

ZeBobo5 commented 11 months ago

Why don't you use GIT submodules in your App Host?

DamianEdwards commented 11 months ago

Dupe of #829