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

Is it possible to programmatically start/stop services? #4403

Open gregpakes opened 5 months ago

gregpakes commented 5 months ago

I was hoping to be able to programmatically start/stop applications in Aspire either in the dashboard or in my own code.

One use case for this is managing EF migrations. Its very cumbersome at the moment using the traditional tooling for EF migrations when the SQL Server is only running when the application is running. Also the fact Aspire manages connection strings automatically adds another layer of complexity to the traditional migration tooling. I wanted a Migration Service running in Aspire to run migrations for me. But I would want to start/stop it on-demand.

Is this possible? or on the roadmap?

davidfowl commented 5 months ago

No it isn't. We discussed making a EF specific tool for doing this, not tied to aspire. No concrete plans though, but there's still lots of complaints around migration tooling and how to make it work well with EF.

mitchdenny commented 5 months ago

Putting this on the backlog and leaving it open for now. Completely valid feedback but we don't yet have a solution.