Spring Cloud Config Server Priority of Environment Variables
<p>I have a question regarding the priority of environment variables when working with <a href="http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_spring_cloud_config" rel="noreferrer">spring cloud config server</a></p>

<p>In my service I have a local properties file <code>application.yml</code> with this content</p>

<pre><code>foo:
  bar: "some"
  buz: "some"
  joe: "some"
</code></pre>

<p>The service is also connected to a config server with a configuration repository that contains a file <code>testservice-api.yml</code> (where <code>testservice-api</code> is the spring application name of the service). The contents of this file is:</p>

<pre><code>foo:
  bar: "some-specific"
</code></pre>

<p>So with this setup the configuration at runtime would result in this:</p>

<pre><code>{
    "foo.bar": "some-specific",
    "foo.buz": "some",
    "foo.joe": "some"
}
</code></pre>

<p>Now I try to override <code>foo.bar</code> and <code>foo.joe</code> with an environment variable. </p>

<p>So I start the service with this command: </p>

<p><code>FOO_BAR=some-env FOO_JOE=some-env gradle bootRun</code></p>

<p>From what I read in <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config" rel="noreferrer">this part of the spring boot documentation</a> the environment variables should have priority over the configuration files - also the spring cloud config documentation does not state sth different - so I would expect the result to be:</p>

<pre><code>{
    "foo.bar": "some-env",
    "foo.buz": "some",
    "foo.joe": "some-env"
}
</code></pre>

<p>But instead I get:</p>

<pre><code>{
    "foo.bar": "some-specific",
    "foo.buz": "some",
    "foo.joe": "some-env"
}
</code></pre>

<p>So only the configuration from the local configuration file inside the jar is overridden by the environment variable - the property from the config repo seems to have priority over the environment variable.</p>

<p>Is this explainable - Or is this a bug? Any hints in this one?</p>

<p>Please find the example code here:</p>

<p><a href="https://github.com/mduesterhoeft/configserver-test" rel="noreferrer">https://github.com/mduesterhoeft/configserver-test</a></p>

<p>The README in the repository lists the issue described here as <a href="https://github.com/mduesterhoeft/configserver-test#use-case-3----override-properties-with-environment-variables" rel="noreferrer">Use Case 3</a></p>