ENVIRONMENTS in ASP NET Core | Getting Started With ASP.NET Core Series

Sdílet
Vložit
  • čas přidán 19. 06. 2024
  • Hello Friend 👋, ASP.NET Core configures application behavior based on the runtime environment using an environment variable. Out of the box, the framework provides three values - Development, Staging, and Production. More can be added based on your needs.
    In this video let's understand more about Environments in ASP NET Core, how it's set, and a few different scenarios where this is used. We will learn about the launchsettings.json file, how the Development environment is set using it. We will also learn how to override values in the file and how we can create custom environments. I will also show you how to use environment specific appsettings.json file and how it works internally.
    00:00 - Introduction
    01:31 - Development Environment
    03:33 - launchsettings.json
    06:15 - Setting Environment variables
    13:30 - Startup Class and Environment
    16:51 - App Settings and Environment
    🔗Docs - docs.microsoft.com/en-us/aspn...
    🔗Source - rahulpnath.visualstudio.com/D...
    🔗WIndows Terminal - www.rahulpnath.com/blog/setti...
    Additional Watching
    📹LOGGING - • LOGGING in ASP.NET Cor...
    📹 STARTUP CLASS - • THE STARTUP CLASS In A...
    📹ASP NET Core Series - • ASP.NET Core
    Come say hi! ✋
    🌍 Blog - rahulpnath.com/
    ✉ Subscribe to my Newsletter - www.rahulpnath.com/subscribe
    🐦Twitter - / rahulpnath
    📸Instagram - / rahulpnath
    🎥 Recording Setup and Workflow - www.rahulpnath.com/blog/youtu...
    Make sure to SUBSCRIBE to the channel. THANK YOU for helping me grow this channel !!
  • Jak na to + styl

Komentáře • 48

  • @orafasistemas
    @orafasistemas Před rokem

    Thank you! very nice video!

  • @ivanpesenti1138
    @ivanpesenti1138 Před 2 lety +2

    Hi Rahul,
    even without subtitles this video is very very clear and valuable.
    U make me discover new things as always

    • @RahulNath
      @RahulNath  Před 2 lety +1

      Thank you Ivan for you constant motivation. It does really help me to keep going 😀 And happy you are finding the videos useful.

  • @gsateesh7643
    @gsateesh7643 Před 6 měsíci

    Very nice explanation bro. Thank you.

    • @RahulNath
      @RahulNath  Před 6 měsíci

      Glad it helped! Do check out the series for more videos bit.ly/asp-net-core-series

  • @rogeriocastellano449
    @rogeriocastellano449 Před 2 lety

    Congratulations, it is very comprehensive about the subject.

  • @chrishaas2904
    @chrishaas2904 Před 2 lety

    Very comprehensive video. What I can't figure out is how when using Azure Devops to deploy a solution, you can specify the environment for the target on premise machine.
    The examples I have found are 1 adding an environment variable at the machine level (not preferred) or adding environmentVariable ASPNETCORE_ENVIRONMENT in the web config that is created from devops if you deploy to IIS. Haven't been able to figure out how to do this automatically yet but I'm working on it. If you have other suggestions would love to hear it.

  • @aikidoshi007
    @aikidoshi007 Před 2 lety

    Brilliant! Thanks Rahul.

  • @beautyIsinEverything753

    very nice explanation.

  • @swapnilvaychale3694
    @swapnilvaychale3694 Před 2 lety

    Great lesson series for asp.net core. I have learned all .net core topics here and which are very practical too. Make aome advance level topics as well.
    Thabk u Rahul

    • @RahulNath
      @RahulNath  Před 2 lety

      Thank you Swapnil. Do drop in any topic suggestions if you have any!

  • @mryildiz702
    @mryildiz702 Před 2 lety +1

    I really like the clear explanations and code examples. I watch your videos on 1.25x or 1.5x speeds :D For me a little faster is better :D Subscribed!

    • @RahulNath
      @RahulNath  Před 2 lety

      Thank you 👍Good feedback on the pace, but glad that increasing the speed is working for you.
      On that note this is the best chrome extension for me 😀chrome.google.com/webstore/detail/video-speed-controller/nffaoalbilbmmfgbnbgppjihopabppdk

  • @sanjayidpuganti
    @sanjayidpuganti Před 2 lety

    Awesome video Rahul. Keep going

  • @callegarip
    @callegarip Před 2 lety

    Another excellent video. Thank you. Do you have a video for a full web.api net core deployment?

    • @RahulNath
      @RahulNath  Před 2 lety

      Thank you Victor. I have a full series where I cover different DevOps scenarios here czcams.com/play/PL59L9XrzUa-m7AFDgjWuwm6exyCklc03U.html
      Also in the latest video here I show a build/deploy pipeline setup relevant to Environment variables in case you missed it czcams.com/video/wTSu2aCoR7Y/video.html
      Is that what you were looking for?

  • @abdullahmirza4661
    @abdullahmirza4661 Před 2 lety +1

    Hi Rahul, Hope you are doing great.
    Well, First of all thanks for teaching us. Secondly i want know how the actual implementation is show to you when you navigate to "env.IsDevelopment()". when i do the same thing i just get the metadata file. I'm using Visual Studio 2019 currently.

    • @RahulNath
      @RahulNath  Před 2 lety

      Thank you ! This is a feature in Jetbrains Rider, one of the main reasons I use it for my videos. www.jetbrains.com/help/rider/Debugging_External_Code.html

  • @amineherizi4687
    @amineherizi4687 Před 2 lety +1

    Thank you, great lesson on the series, can you please post videos on docker and kubernetes in the future ?

    • @RahulNath
      @RahulNath  Před 2 lety

      Thank you for the suggestion. Anything in particular you are looking from Docker?

    • @amineherizi4687
      @amineherizi4687 Před 2 lety +1

      @@RahulNath Docker in context of micro services please

    • @RahulNath
      @RahulNath  Před 2 lety +2

      @@amineherizi4687 Thank you for clarifying. Sure will. Between have you come across this github.com/dotnet-architecture/eShopOnContainers#related-documentation-and-guidance

  • @mohammedalbosifi3975
    @mohammedalbosifi3975 Před 2 lety

    Thank you dear... We need a video to explain Kafka (message broker) with asp. Net core

    • @RahulNath
      @RahulNath  Před 2 lety

      Glad you like it and thank you for the suggestion. Added it to the list!

    • @mohammedalbosifi3975
      @mohammedalbosifi3975 Před 2 lety +1

      @@RahulNath thank you mester rahul

    • @RahulNath
      @RahulNath  Před 2 lety

      @@mohammedalbosifi3975 😀

  • @anilanandachakrabortty1416

    Nice video! How do i archive the same behavior with azure Pipeline with multiple environment app settings?

    • @RahulNath
      @RahulNath  Před 2 lety +1

      Thank you. Please check out these two videos that shows this
      czcams.com/video/eGcosoC43vI/video.html
      czcams.com/video/OFr6Vkw0mq8/video.html
      Let me know if that helps or if you have additional questions.

  • @ashleyrodrigues1468
    @ashleyrodrigues1468 Před rokem

    Hi Rahul, if launch settings json is not deployed how will the environment name be detected after deploying

  • @shaunrod114
    @shaunrod114 Před 2 lety +1

    Hi rahul
    hope you are doing well mate in this lockdown!!
    do you have any videos explaning deploying of an application into an public cloud domain ?
    let me know
    cheers

    • @RahulNath
      @RahulNath  Před 2 lety

      Hey Shaun, I am doing good. Hope you are doing well during the lockdown/covid too.! Stay safe.
      I have a DevOps series that shows various deployment scenarios, mostly for Azure czcams.com/play/PL59L9XrzUa-m7AFDgjWuwm6exyCklc03U.html
      Is that what you are after? Can you please provide more details if not?

  • @younesreguieg4756
    @younesreguieg4756 Před 2 lety

    i have two files appsettings.Development.json & appsettings.Production.json, i want to apply ef_core update-database according to environment development or production put command doesn't work
    "dotnet ef database update -- --environment Production" always apply developmnet file

    • @RahulNath
      @RahulNath  Před 2 lety

      Based on the environment you can overrider the configuration values getting picked up. Highly recommend checking out the Configuration video czcams.com/video/5GlgHV_12-k/video.html
      Also check out different ways you can manage configuration www.rahulpnath.com/blog/handling-application-configuration/
      Let me know if that helps or if you have additional questions.

  • @mdabuzar2130
    @mdabuzar2130 Před 2 lety +1

    AKS

    • @RahulNath
      @RahulNath  Před 2 lety

      Not sure how soon that will be, I haven't worked much on it. So it will be a while later, but thank you for the suggestion

  • @hendrykhoza4782
    @hendrykhoza4782 Před 2 lety +1

    I just want to hide my API Keys... how do I do that... by default the appsettings get push to my git repository

    • @RahulNath
      @RahulNath  Před rokem +1

      I cover it in details in this blog post and associated videos www.rahulpnath.com/blog/handling-application-configuration/
      Hope that helps.

    • @shauncs
      @shauncs Před rokem

      @@RahulNath I want to hide db connection string and some other keys in production. I can't use any managed service like Azure key vault. So I'm thinking of keeping it as a System environment variable. Saving a single key value pair like this and read them in .Net is simple and straight forward. But when it comes to saving a nested value as a system env variable and reading it always gives me Null value. Do you have any idea what I'm doing wrong?

    • @RahulNath
      @RahulNath  Před rokem +1

      @@shauncs Is it the delimiter that you are using? Do you have an example on what's failing?

    • @shauncs
      @shauncs Před rokem

      @@RahulNath Got it sorted by adding __ (double underscore). Thanks anyways

  • @mdabuzar2130
    @mdabuzar2130 Před 2 lety +1

    Micro services

    • @RahulNath
      @RahulNath  Před 2 lety +1

      Yes thank you for the reminder 😀 Working on some content ideas.

  • @techpc5453
    @techpc5453 Před rokem