Skip to content

Instantly share code, notes, and snippets.

@jeffjohnson9046
Last active May 26, 2022 17:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jeffjohnson9046/3f18eb0de8c9674347abbd978ba78e6d to your computer and use it in GitHub Desktop.
Save jeffjohnson9046/3f18eb0de8c9674347abbd978ba78e6d to your computer and use it in GitHub Desktop.
use curl to check out a Spring Boot applicaion's configuration properties from a Spring Cloud Configuration service
# Occasionally I want to see the application properties that are pulled down from the Spring Cloud Config service that provides
# content to our Spring Boot apps. Since I seem to have to re-discover this every time, I figured I'd write it down to help me
# remember.
#
# Additional docs can be found here: https://cloud.spring.io/spring-cloud-config/single/spring-cloud-config.html
# To see the output in YML format
curl -u {the user name}:{the user password} http://{the domain:port}/{the application name}-{the spring profile name}.yml
# For example:
# * the application is "my-spring-boot-app"; this is the name of the application's yml file that's stored in version control
# (e.g. my-spring-boot-app.yml)
# * the Spring profile is "dev"
curl -u exampleUser:examplePassword http://configuration-service:8888/my-spring-boot-app-dev.yml
# If using branches to specify the configuration and not Spring profiles, then Spring will fall back to the "default" profile.
# In this case, the call looks a little bit different:
curl -u {the user name}:{the user password} http://{the domain:port}/{the application name}/{the Spring profile or "default"}/{the branch name}
# For example:
# * the application is "my-spring-boot-app"; this is teh name of the application's yml file that's stored in version control
# (e.g. my-spring-boot-app.yml)
# * The spring profile is not set (meaning Spring falls back to "default")
# * the branch is we want to use for configuration is "staging"
curl -u exampleUser:examplePassord http://configuration-service:8888/my-spring-boot-app/default/staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment