Externalizing environmental config using environment variables

In the previous recipes, we have a number of times eluded to the fact that the configuration values to a Spring Boot application can be passed and overridden by using OS Environment Variables. Operating Systems rely on these variables to store information about various things. We probably have come across having to set JAVA_HOME or PATH a few times and these would be the examples of environment variables. It is also a very important feature in case one deploys their application using a PaaS Platform such as Heroku or Amazon AWS. In these environments, configuration values such as database access credentials and various API tokens are all provided over the environment variables.

Their ...

Get Spring Boot Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.