Spring Cloud: Overriding the Values of Remote Properties
The property sources that are added to you application by the bootstrap context are often “remote” (e.g. from a Config Server), and by default they cannot be overridden locally, except on the command line.
If you want to allow your applications to override the remote properties with their own system properties or config files, the remote property source has to grant it permission by setting spring.cloud.config.allowOverride=true
.
It doesn’t work to set this locally. It must be set as property in the remote property source (i.e.
{application}-{profile}.properties
file on a Git repository).
Once that flag is set there are some finer grained settings to control the location of the remote properties in relation to System properties and the application’s local configuration:
spring.cloud.config.overrideNone=true
to override with any local property sourcespring.cloud.config.overrideSystemProperties=false
if only System properties and env vars should override the remote settings, but not the local config files
Configuration example
spring.cloud.config.allowOverride=true spring.cloud.config.overrideNone=false spring.cloud.config.overrideSystemProperties=false
References
https://cloud.spring.io/spring-cloud-static/spring-cloud.html#overriding-bootstrap-properties