Add .NET Aspire Sample
Hey Edwin! I figured it would be fun to give .NET Aspire a try. Pitstop is the single best option to give it a try since you're running microservices :-) So here it is, my PR to show the .NET Aspire bits.
What's in the pull request
- [x] .NET Aspire AppHost to orchestrate the solution
- [x] Service discovery
- [x] SQL Server component
- [x] RabbitMQ component
- [x] Service defaults
- [x] Structured logging
Time to show off. Structured logging works. It also correctly detects errors.
The dashboard itself looks cool too. All endpoints show up. And I can see when a service fails.
Tracing also works really well. It links to logs and provides a nice overview of where the data is going. I'm missing the link to RabbitMQ here. Maybe we need to add extra code in the messaging infrastructure to copy over trace IDs.
My conclusions:
- It is possible to integrate Aspire in an existing code base. But it's neater to start from scratch.
- I don't get why they inject
SqlConnectionfor SQL server andIConnectionfor RabbitMQ. It's super weird. - The value of Aspire for me is mainly in the local dev setup. I can now press F5 and be on my way.
Things I haven't tried:
- ~Deploying to Kubernetes using the Aspire tooling. I don't know how smooth that's going to be.~
- Using the security component. I don't think it has a place in pitstop.
- Using the caching components. There's no use case here either.
Turns out that Kubernetes isn't supported as a deployment target yet. They do support Azure Container Apps
Please let me know what you think! I had a lot of fun trying it out on the code.
Thanks for integrating dotnet aspire into this. We're using this repo as an example repository to teach students several architecture styles, and I was looking for that I can now press F5 and be on my way feel.
Unfortunately I am having a lot of trouble getting it to build and run. Can you provide some guidance ? I suspect the issues are between the aspire workload version and visual studio preview version.
Here's what i've encountered:
- An unresolved reference to Dapper in the AppHost
- The AppHost not recognizing the Projects namespace
- Tried to upgrade the Aspire packages to match the Aspire workload version but bumped into a lot of breaking changes.
- Tried to downgrade the workload version to match the Aspire packages but failed in doing so.
Clearly i am missing something 😄
Hi @avans-marc, thanks for your interest in Pitstop. This PR was simply an experiment by wmeints to see what it takes to integrate Aspire into an existing application. It was not my intention to actually add Aspire to Pitstop and the code in the PR is also not updated. Therefore I cannot help you with this. I will also close the PR to prevent any confusion in the future.