I have set spring.cloud.bootstrap.name to the name of a custom bootstrap file for a non-Cloud version of spring cloud config server. I did this by setting system property as a JVM arg:

-Dspring.cloud.bootstrap.name=bootstrap-CUSTOM

The file is found when not running in Cloud.

The issue is that when I do the same for the service running in Azure, the file is not found and the service tries to start without any bootstrap file. This is set as env variable via helm chart:

spring.cloud.bootstrap.name: bootstrap-CUSTOM

When I run the service in cloud without spring.cloud.bootstrap.name being set, it finds our default bootstrap.yml file as expected. Both the default and custom files are in the same directory and I have verified both are in my war file.

The question is, since the custom bootstrap is in the war file, why wouldn't it be found when config server is running in the Cloud and set via env variable?

Our Dockerfile is very basic and deals with the war and not individual files. If spring can find the main bootstrap.yml in the war, I would expect it to have no trouble finding bootstrap-CUSTOM.yml in the war. I don't know if you have enough info to solve, but can you think of reasons the framework would behave differently, so that I have some idea where to begin investigating?

Edits

  • Spring boot version: 2.1.4.RELEASE

  • I also tried setting the custom bootstrap via Windows Env variable on-premise (instead of system property), and that also worked as expected - the file was found.

Comment From: marnee01

Additional info: For the Cloud service I tried setting the bootstrap to the name of the default bootstrap file, and this works:

spring.cloud.bootstrap.name: bootstrap

Comment From: spencergibb

I'm sorry, I don't understand what "a non-Cloud version of spring cloud config server" is. We don't support the managed versions running on azure. What version of spring cloud are you using? This makes no sense to me

spring.cloud.bootstrap.name: bootstrap: bootstrap

Comment From: marnee01

Sorry, there was a mistake in:

spring.cloud.bootstrap.name: bootstrap

It's corrected now to the above.

By "non-Cloud version of spring cloud config server", "version" is the wrong term. I just meant, it's not running as a Cloud service.

Version of spring cloud: spring-cloud-config-client-2.1.4.RELEASE.jar. Is that the specific one you're looking for?

Comment From: spencergibb

If this only happens in an azure managed service, I'd say you need to contact their technical support.