Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.