title: How do you properly set different Spring profiles in bootstrap file (for Spring Boot to target different Cloud Config Servers)?
body: <p>We have different config servers per environment. Each spring boot application should target its corresponding config server.  I have tried to achieve this by setting profiles in the bootstrap.properties file, e.g.:</p>
  
  <pre><code>spring.application.name=app-name
  spring.cloud.config.uri=http://default-config-server.com
  
  ---
  spring.profiles=dev
  spring.cloud.config.uri=http://dev-config-server.com
  
  ---
  spring.profiles=stage
  spring.cloud.config.uri=http://stage-config-server.com
  
  ---
  spring.profiles=prod
  spring.cloud.config.uri=http://prod-config-server.com
  </code></pre>
  
  <p>And then I set the cla <code>-Dspring.profiles.active=dev</code> but the loaded config server is always the last one set in the file (i.e. prod config server would be loaded in the above settings, and then if prod is removed, stage would be loaded). </p>
  
  <p>Is it possible to set bootstrap profiles for the cloud config server? I followed <a href="https://stackoverflow.com/questions/36934873/set-profile-on-bootstrap-yml-in-spring-cloud-to-target-different-config-server">this example</a> but can't seem to get it working. For what it's worth, these profiles work great to load the correct config (i.e. app-name-dev.properties will load if the dev profile is active), but aren't being pulled from the proper config server.</p>