Last active
May 26, 2022 17:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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