Search code examples
spring-bootconfiguration-files

Why Spring Boot Cloud Config Server properties not picked from GIT


I have the following issue. Just with the basic Spring Boot Config Server, I would like to read property file from my Github (i tried also Gitlab). Everything works localy, the property file is nicely loaded from Github, but after deploying application on any other environment, for example on Heroku or on dedicated Linux server, the property file is not loaded. I am checking http://localhost:8101/employee/service1 Loading the property file from local files (classpath:config/local) works very well both locally and on other environments. What I am doing wrong? I have created simple project on Github (https://github.com/troger19/config-server), if anybody can check. Also app is deployed on Heroku: https://protected-savannah-48323.herokuapp.com/employee/service1

The application.yml looks like this

server:
   port: 8101
 spring:
  application:
   name: config-server
cloud:
  config:
    server:
     git:
       uri: https://github.com/troger19/config-server
       search-paths: src\main\resources\config\dev

And the employee-service1.yml is in resources/config/dev

I havent find anything in the logs so far. Thank you for any suggestion.


Solution

  • Please change use "/" for linux environment as "\" will only work on window environment.

    Please change your search-paths: src\main\resources\config\dev to /src/main/resources/configdev

    Good idea to use different-2 profile in yml file for different environment so such can be avoided.