Migrating From Docker Compose to .NET Aspire (my experience)

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 87

  • @MilanJovanovicTech
    @MilanJovanovicTech  Месяц назад +2

    Get the source code for this video for FREE → the-dotnet-weekly.ck.page/docker-aspire
    Want to master Clean Architecture? Go here: bit.ly/3PupkOJ
    Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt

  • @nothingisreal6345
    @nothingisreal6345 Месяц назад +7

    Great video. Love Aspire. There a couple of further thins to consider e.g. what if you used DB first instead of cod first for EF Core.... Another thing I struggle with was using the neat Aspire dashboard not only when developing but in a deployed hosting e.g. on Azure. Sure there are ways to access the Open Telemetry with Azure itself, but I just love the integrated approach the Aspire Dashboard provides. Maybe another interesting topic to cover is how to handle secrets with e.g. Azure Key vault and some of the edge cases (e.g. restriction in how to name stuff).

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      @@nothingisreal6345 Nowadays when you deploy Aspire with AZD you get the Aspire Dashboard out of the box

  • @antonmartyniuk
    @antonmartyniuk Месяц назад +2

    Fantastic video, enjoyed watching it.
    Well done

  • @mohideenasraf7837
    @mohideenasraf7837 17 дней назад +1

    Hey Milan, thanks for the video! It would be really helpful if you could explain the differences between Docker and Aspire. Also, could you highlight the advantages of Aspire over Docker? That way, we can make a more informed choice based on our requirements. Thanks!

  • @user-uo7ch2lf3z
    @user-uo7ch2lf3z Месяц назад +1

    Wonderful video. I wish you could further show us how this could extend to deployment to Azure. Stay Awesome!

  • @DotNetFun
    @DotNetFun 23 дня назад

    Great video. Have you used Aspire on any projects in production environment? what were the challenges in your opinion?

    • @MilanJovanovicTech
      @MilanJovanovicTech  23 дня назад

      Deployed a few demo apps with Aspire, and so far it's been smooth sailing. The deployment is a bit messy, IMO. You'd need to rewrite it to your CI to simplify it.

  • @jcorrify
    @jcorrify Месяц назад +1

    I would love to see an exemple with multi repo setup

  •  Месяц назад

    Gracias, excelente contenido.

  • @egemenakdan8139
    @egemenakdan8139 Месяц назад +2

    the missing part on this video is how do you secure the aspire dashboard from anyone that knows your aspire url??

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +4

      When deploying to Azure, it runs behind a reverse proxy that also performs Authentication. So, only users with a valid account can access the Aspire dashboard.
      If deploying it yourself, you just place a reverse proxy in front of the UI that does an OAuth redirect if the current user is unauthenticated.

  • @gabrielzalisz
    @gabrielzalisz Месяц назад

    Milan, I'd love you to make a video about deploying Aspire apps to on-premise Kubernetes cluster.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      Recorded an Azure ACA deployment video, coming out soon. ACA is basically a managed Kubernetes, if you will.

  • @ahmedabdellatif4797
    @ahmedabdellatif4797 2 дня назад

    How would one go about developing and running a single service locally, how would that go with the way you configured the connection strings?

    • @MilanJovanovicTech
      @MilanJovanovicTech  День назад

      You can just plug the connection strings as ENV vars with the correct name

  • @LindenMikus
    @LindenMikus 23 дня назад

    is this for dotnet compatible projects? what if i have a web app backend in java, frontend angular. can i setup it to run in dockerfile and then plugin to aspire? possible to debug docker containers from aspire?

    • @MilanJovanovicTech
      @MilanJovanovicTech  23 дня назад

      Yes, here are a few samples:
      - learn.microsoft.com/en-us/dotnet/aspire/app-host/withdockerfile
      - learn.microsoft.com/en-us/dotnet/aspire/get-started/build-aspire-apps-with-nodejs
      - learn.microsoft.com/en-us/dotnet/aspire/get-started/build-aspire-apps-with-python

  • @mohamedkabha1761
    @mohamedkabha1761 Месяц назад

    Hi Milan thanks for the great video, I have a question Can we use Keycloak with Aspire? It is confusing me how to configurate the AppHost with the docker Keycloak container or even any external docker container!

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      Yes, it's all explained nicely in the docs. Works great.

  • @RyanBuening
    @RyanBuening Месяц назад

    Very cool @MilanJovanovicTech! You mentioned nginx at the beginning of the video...are there migration things to consider from that standpoint when attempting to deploy an Aspire setup to a Linux server?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      No, this was just me trying to run the Blazor WA app in docker-compose. It'll run "out of the box" with Aspire. Not sure about the deployment though.

  • @teejstroyer
    @teejstroyer Месяц назад

    We have several legacy services that use hardcoded service.env for urls, it possible to set up something similar with aspire? Effectively setting the service name the same way you would with docker compose?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      Yes, grab the MSFT service discovery nuget: learn.microsoft.com/en-us/dotnet/core/extensions/service-discovery?tabs=dotnet-cli

  • @kaozryan
    @kaozryan Месяц назад

    Nice! How can i deploy an aspire project? Like to Openshift or Azure.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      Recorded a video, releasing soon!
      TL;DR - Use the Azure Developer CLI
      - azd init // sets up some boilerplate
      - azd up // deploys the app

  • @ahmedabdulla3330
    @ahmedabdulla3330 Месяц назад +1

    Is this deployable to AWS ? Or is Azure only?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      @@ahmedabdulla3330 Azure for now. Unsure about AWS support 🤔

  • @pavelromashuk237
    @pavelromashuk237 Месяц назад +1

    What to do with deployments to containers in clouds? Is there workaround?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +2

      @@pavelromashuk237 Video coming up soon!
      But it's as simple as:
      > azd init
      > azd up
      It'll create a resource group, and deploy each service in Azure Container Apps.

    • @nothingisreal6345
      @nothingisreal6345 Месяц назад

      In VS there is a publish. Works like a charm

    • @pavelromashuk237
      @pavelromashuk237 Месяц назад

      @@MilanJovanovicTech Nice. Thanks

    • @RavinduNanayakkara
      @RavinduNanayakkara Месяц назад +1

      Good advice from others, if you want some control over the resources created (resource naming in Azure), you can use azd infra synth to generate and modify the bicep templates used by azd.
      Another heads up is that azd up wipes custom domains you set in the Azure portal, you have to opt into a config setting to keep them.

    • @mohammadumar443
      @mohammadumar443 Месяц назад

      @@MilanJovanovicTech how can we deploy it to our custom vnet to apply different other services to the network ? is it possible to deploy aspire app into custom vnet right now ?

  • @vikasjoshi4708
    @vikasjoshi4708 Месяц назад

    Hey @Milan, thanks for demonstrating migration, Just to confirm, are you still running postgres and rabbitMQ inside docker.

  • @sudidav
    @sudidav Месяц назад

    Damn, it is awesome!

  • @itirush2701
    @itirush2701 Месяц назад

    How use EF and Dapper in one Repository? It’s good practice ? Please make video. 😅

  • @vyteniskajackas7579
    @vyteniskajackas7579 Месяц назад

    Could you give ideas how to use aspire dashboard on deployed applications? I know this is meant for local development and everything can be acceessed in azure or aws, but I just like the way it looks and presents everything. Lastly, how to properly set up everything, so that "Endpoints" contain the actual application endpoints (to swagger and whatever) for me they are usually empty and when I try to add them using WithHttpEndpoint, they just act weird

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      @@vyteniskajackas7579 Aspire deployment with AZD already sets up the Aspire Dashboard in prod :) Video coming up.

  • @bartlomiejuminski
    @bartlomiejuminski Месяц назад

    9:20 I had this error with Blazor WASM and Aspire setup. That's why I chose Docker. I think I will give .NET Aspire another chance in the future.

  • @sunnychu19951
    @sunnychu19951 Месяц назад

    Love it.

  • @10Totti
    @10Totti Месяц назад

    if i want publish project Aspire on my vps ?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      A bit more complicated. We can generate Bicep files and customize them for deployment.

    • @10Totti
      @10Totti Месяц назад +1

      @@MilanJovanovicTech So I wonder what's the point of using it only to develop on your own computer?

  • @Prabhuchandan
    @Prabhuchandan 14 дней назад

    Can you please make a video on using .NET Aspire as test container for integration testing?

  • @haraheiquedossantos4283
    @haraheiquedossantos4283 Месяц назад

    Pretty cool video

  • @NileshJaiswal_learn
    @NileshJaiswal_learn Месяц назад

    Awesome @milan

  • @xardasu3646
    @xardasu3646 Месяц назад

    Does Aspire support Node frontend like Next.js ?.

    • @Cheggers-pq1pn
      @Cheggers-pq1pn Месяц назад

      Yep. There is a Nodejs hosting package, and a couple examples in the aspire samples of its use on the aspire-samples github repo.

    • @modernkennnern
      @modernkennnern Месяц назад +1

      Depends on what you mean by "Support", but it can definitely start, stop, and restart the apps, show telemetry, add environment variables, and add custom commands to next.js applications. We use Aspire on the project I'm working on atm and that's using next.js ( unfortunately..)

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      I think there's a community package that adds support for that

  • @razbasnet173
    @razbasnet173 22 дня назад

    What about deployment 🤔

  • @zebrg
    @zebrg Месяц назад

    Aspire mixes application with devops. Fine for one man projects but I don't see how this is a good thing for large projects with lots of services running in kubernetes for instance. And, if it does not scale, why not learn "the correct way" from the beginning?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      For large projects, you can use Aspire for the local part and deploy on your own?
      90% (maybe more) of teams don't need kubernetes

  • @KarthikS30712
    @KarthikS30712 Месяц назад +4

    I trust Milan, not Microsoft.

  • @sunzhang-d9v
    @sunzhang-d9v Месяц назад

    Get the source code for this video for FREE ,Unable to run?

  • @MiningForPies
    @MiningForPies Месяц назад +2

    Aspire is very very unstable, and is very likely only going to support dotnet 9, which no serious development team will run in production.

    • @IAmFeO2x
      @IAmFeO2x Месяц назад +2

      No, Aspire 9 will be compatible with both .NET 8 and .NET 9 and you are able to orchestrate anything since it can use docker or podman. Either use images from docker hub or any other container registry, or simply write your own dockerfiles. Sure, configuration gets more complicated than with aspire hosting packages, but in the end you can write your own.

    • @MiningForPies
      @MiningForPies Месяц назад

      @@IAmFeO2x no, the aspire tooling will stop supporting net 8 when the net 9 version is complete.
      They don’t care for backwards compatibility. It’s not production ready.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +2

      Aspire 9 will work on .NET 8. Where are you getting this from?
      Why wouldn't you run .NET 9 in production? Just one step away from .NET 10...

    • @MiningForPies
      @MiningForPies Месяц назад

      @@MilanJovanovicTech anyone that runs an interim version of .net in production is asking for trouble.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +2

      @@MiningForPies What kind of trouble?