I am trying to migrate our stable application server to get their configuration from the Spring Cloud Config server. Each application has a {my-app}.yml on the configuration server, and we can use profiles (either in files named {my-app}-{profile}.yml , or using multi-profile YAML documents) to have a different configuration for each environment for each application, and we can even include one profile in another, using spring.profiles.include to provide some kind of inheritance - so far so good.
However, we can only include profiles from one application into each other, and we have several applications configured from the same configuration server that use many configurations for each environment - for example, almost all of them use the same DataSource configuration connections to the same database, as well as for messaging, cache, etc. These are a lot of duplicate configurations and many places that need to be changed - exactly what Spring Cloud Config should avoid!
Is there a way to "enable" (through profiles or otherwise!) The general configuration properties in applications in the Spring cloud configuration server?
Update
In addition to the correct answer to @vladsfl below, beware that if you use your own profile on the configuration server to serve the configuration from the file system or classpath instead of the git repository, the configuration server will use the application. yml and its profile options for themselves, but refuse to serve them in other applications. The solution is to use spring.cloud.config.server.native.searchLocations to pull the served configuration out of another place.
source share