Spring Boot Environment Variables Explained (Secure Your API Keys!)

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 30

  • @ValentinoPezzano
    @ValentinoPezzano 3 місяці тому +2

    Thanks Dan, your stuff is never boring, and brings always value. keep going!

  • @Nico-ly7lh
    @Nico-ly7lh 3 місяці тому +2

    Short and useful. That’s what I need every end of the day to learn a little piece, to become better 🎉

    • @neverexperience
      @neverexperience 2 місяці тому

      u call that short?

    • @Nico-ly7lh
      @Nico-ly7lh 2 місяці тому

      @ yes! To long for you? Skip unimportant parts or use the play speed button :)

    • @neverexperience
      @neverexperience 2 місяці тому

      @@Nico-ly7lh well kinda, he fixed my issue tho :0

  • @ratikantapradhan1537
    @ratikantapradhan1537 3 місяці тому

    Thanks. Not boring at all. Now I am confident, I am using correct one.

  • @wagnerdba
    @wagnerdba 3 місяці тому +3

    Tks... Congrats from Brazil.

  • @amardeep.sahota
    @amardeep.sahota 3 місяці тому +2

    Thanks for covering this. You should have spent some more time on springboot relaxed binding where it can automatically map your env variables with properties based on certain rules like replace underscore with dot, delete all hyphens and lowercase to uppercase.

  • @TusharKumar-u4p
    @TusharKumar-u4p 4 дні тому

    For those who are using VScode they can go to run -> add configuration, After this a launch.json file will be created there they can define the environment variable and corresponding value under a env object

  • @vanamutt43
    @vanamutt43 3 місяці тому +1

    Hey Dan, been watching you for years, right from when i started learning how to code to the first grueling months as a junior to now when i have 3 years of professional coding experience. Love your videos and your style, i will continue watching as long as you make them. Regards from Estonia.

  • @victoranski1
    @victoranski1 3 місяці тому +1

    came here to give my like!

  • @gasparcalix2095
    @gasparcalix2095 3 місяці тому

    Grate! as always!

  • @Muescha
    @Muescha 2 місяці тому +1

    07:30 If I store it in the Run Configuration, will it be included in the repository and become public (if I also push my `.idea` folder to the repo)?

  • @vrkv380
    @vrkv380 3 місяці тому

    Hi Dan. can you please add a playlist on microservices covering several design patterns

  • @MarcosPereira-hx2yy
    @MarcosPereira-hx2yy 3 місяці тому

    goods video!!!!! useful great

  • @ainigma100
    @ainigma100 3 місяці тому

    Thank you Dan for the video!
    How can a Spring Boot 3 application handle secrets like database passwords and API keys that need frequent rotation due to expiration? Using a key vault helps with security, but it doesn’t solve the issue of updating secrets in a running application without downtime. Is there a reliable way to dynamically refresh secrets at runtime without relying on cron jobs or fetching secrets only during deployment? Can you please create a video about properly handling secrets inside your spring boot 3 application.

  • @nikochen832
    @nikochen832 3 місяці тому

    BTW using jps command can check the env variables in the terminal.

  • @neverexperience
    @neverexperience 2 місяці тому +1

    thanks, I'm new to springboot, I'm from JS background
    I just wanted to know if we can create a .env file like we do in js? I tried a couple of times and failed, is there a way like that or do I need to add it in intelliJ project configs?

  • @gm0101
    @gm0101 3 місяці тому

    About security should I be concerned about that the environment variable could be discovered if you check the list of running process or even declared as environment variable?
    Another point: And what about application profiles configuration, settings as environment variable for different environments (dev/production) should be considered better than profiles?

    • @zerocodercool
      @zerocodercool 3 місяці тому

      I believe Spring Cloud Config would be a better option for such cases.

  • @arnoldtuber
    @arnoldtuber 3 місяці тому +7

    Make Java Great Again 2024

  • @nvtentertainment4098
    @nvtentertainment4098 2 місяці тому

    If i not use Inteliji , how to setup eviroment ? , can i use .env lik nodejs ?

    • @spalidoro
      @spalidoro 2 місяці тому

      application.properties in Java has the same functionality as the .env in Node.js

  • @sadiulhakim7814
    @sadiulhakim7814 3 місяці тому

    I do not even go to spring initializer. I generate the project directly from inside Intelij.

  • @worldwide6626
    @worldwide6626 3 місяці тому

    How can I do this in VS Code?

  • @arynews104
    @arynews104 3 місяці тому

    can i develop Ai teacher or AI recuriter if i watch and learn your videos

  • @vrvr82
    @vrvr82 3 місяці тому +1

    Having an environment variable named "APP_API_KEY" is enough, you do NOT have to write something like "app.api.key=${MY_API_KEY}".
    See "Externalized Configuration" > "Binding From Environment Variables" in Spring Boot documentation.

    • @DanVega
      @DanVega  3 місяці тому +4

      @@vrvr82 I mentioned that but I thought showing it off this way might make it a little more explicit and click 🤷‍♂️

  • @pranjalsharma5611
    @pranjalsharma5611 3 місяці тому +1

    All is well until it goes to production that's what I need to focus on