What is .NET Aspire? Why do you NEED it in every .NET app? How to get started in minutes!
HTML-код
- Опубликовано: 13 июл 2024
- .NET Aspire is an opinionated, cloud ready stack for building observable, production ready, distributed applications, and it is AWESOME! You may have seen a lot of demos about what .NET Aspire is and how to get started with the amazing templates, but let's look at how to add .NET Aspire to an existing .NET API back-end, Blazor front-end, and then add in Redis Cache, Garnet, Open Telemetry, and Postgres!
Links:
Docs: learn.microsoft.com/dotnet/as...
Tutorial: learn.microsoft.com/dotnet/as...
Garnet: github.com/microsoft/garnet
Videos: • .NET Aspire
Chapters:
00:00 - Intro & project walkthrough
02:15 - Add .NET Aspire Orchestration to .NET API
05:25 - Exploring Dashboard and Telemetry
06:58 - Add .NET Aspire to Blazor app and enable Service Discovery
12:45 - Adding Redis Cache to .NET Aspire
16:00 - Adding PostgresSQL and PgAdmin
18:30 - Adding Garnet to existing Redis Client
20:30 - Wrap-up
Join this channel to get access to perks:
/ @jamesmontemagno
👕 Buy some swag! - jamesmontemagno.myspreadshop....
☕️ Buy me a coffee - www.buymeacoffee.com/jamesmon...
Follow:
👨💻 GitHub: github.com/jamesmontemagno
🦜 Twitter: / jamesmontemagno
📄 Website: www.montemagno.com
📰 Newsletter: newsletter.montemagno.com/
Disclaimer: This channel, videos, and streams are created in my spare time and are a product of me... James Montemagno! They are NOT officially affiliated or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.
What is on my hat? It is the CLE clothing logo because I am from Cleveland! Checkout their awesome CLE merch: cleclothingco.myshopify.com/
What is that art on my wall? It is an original piece from the French street artist Gregos of La Butte Montmartre: / bcez1onhiqx
My Setup:
📷 Canon M50 Mark II - amzn.to/3P8R7lp
💡 Nanoleaf Elements Lights - amzn.to/3umwJVW
🎙 Blue Spark Microphone - amzn.to/3qgtYkq
🎙 Blue Pop Filter - amzn.to/3jEWM3r
🤳 Rode Microphone Arm - amzn.to/2Z68AlE
🎧 Sony MDR7306 Headphones - amzn.to/372jxta
📲 Stream Deck - amzn.to/373Uk1n
🖱 MX Master 2S Mouse - amzn.to/3d7J2gj
⌨️ Tecware Phantom Keyboard - amzn.to/3aUP4y9
Using links I provide I may receive a commission if you buy something which helps support the channel.
#dotnet #dotnetaspire #aspire #visualstudio #blazor #aspnetcore Наука
Thanks James, your demo makes .NET Aspire interesting and easy to understand :D
Great to hear!
This is crazy simple. Thanks for this video, as always a fantastic tutorial.
As always you have been excellent James! Thanks!
Hope next time you can demo how to add .NET MAUI application in .NET Aspire
Awesome James, Thanks!
Very informative, thank you!
Great video!
Can you make a video on how to deploy it?
Afaik, the aspire projet reference the hardcoded .csproj file
Amazing !!!
AMAZING!
That looks awesome. I would like to see more, eg using a reverse proxy like Nginx, configuring SSL with letsencrypt and deploying all that to a virtual maschine.
You can easily use YARP for reverse proxy - see github.com/dotnet/eshop
What can I say ! You are the best :)
This is interesting ❤
Awesome tech, awesome presentation with that zooming and nice tempo!
How easily can we then deploy this to a self-hosted linux server?
Hey James, nice work. Would be great if you show the deployment process using .Net Aspire.
Coming up in future video
Can we use .Net Aspire with a Azure Static Web App with Blazor WASM (Client) and Azure Functions (Api) - Will it replace GIT hub Actions?
Great tutorial, thank you! How would you handle a scenario where Aspire is used for local development only? Do you still integrate the Aspire NuGet packages into your projects (eg. Aspire.Npgsql for Postgres)?
Those packages depend solely on configuration. They are not for local development only.
Please look at an example with DAPR or any service that fails to start without a referenced service running yet (I.e. the database isn’t yet up). Or even just explain some mitigations for this scenario? Otherwise short and simple and informative video thanks
Great video.
A question : In your example, does this mean you can use a postgre database from your backend after having configured .net aspire ? Then, how to use it from your backend ?
Use the resource id ('db') in connection string. I think he missed .WithDatabase() part.
It's all very cool. But the missing piece is the deployment to the Cloud Platform, which was the last sentence in your presentation. I realize it is a preview, but frankly, it will remain a preview until that part is demonstrable.
I am looking forward to your future video covering that.
Lots of docs: learn.microsoft.com/en-us/dotnet/aspire/deployment/overview Have a video on the way as well. Many devs will only end up using aspire for development purposes if they already had deployment setup as well, which is totally valid
we should do a collage of all of james hair styles and beards lol 😂
How do you publish to use a custom azure vnet?!
Watching a video with Fowler and Edwards they say Aspire is for the local development environment only and you dont deploy anything. But you modified your two existing projects with AddServiceDefaults so now you do need to deploy the project that provides that into say production and what happens if all the ServiceDefaults are not valid for production?
The apphost project is not deployed. Service defaults are used by your applications and are deployed.
Do you have any videos on monorepos?
I don't anything specific?
How to deploy the Aspire app to Azure. Please do a video.
Can this be used with React or other Javascript technology?
Absolutely! check this out: learn.microsoft.com/en-us/dotnet/aspire/get-started/build-aspire-apps-with-nodejs
How do we add user access/control for net Aspire for production environment?
It’s just a .NET app so the same way as normal. Aspire just adds to your app. It isn’t a new app
Is it possible to use this with Blazor WASM?
Should be able to yeah
@JamesMontemagno sorry meant WASM Standalone, not that new one
How do you deploy it? Will it automatically deploy all the services?
Will have a video soon but check the docs to show you deployments
Can i add Aspire to a .NET app that is hosted at AWS or Azure ?
Yup, they added CDK support in the latest preview
I think you will lose a few features hosting with AWS than with Azure.
It's unfortunate that you have to add specific to aspire packages to your projects
But you didn't explain how to access those containers in backemd app.
Each component is documented and I showed how to add the component via nuget. Will be in my next video