Closed falk-stefan closed 3 years ago
It looks like you're using the secretmanager module -- those settings have to be put in a bootstrap.properties instead of application.properties.
This is because the secrets are loaded by the "bootstrap phase" of Spring. The bootstrap.properties
file is placed in the resources/
directory same as the application.properties
file.
Let me know if this fixes the problem for you. I will also look into ways of documenting this better -- were you looking at sample apps or docs, etc.?
EDIT: Not sure why the database name is not being picked up though. Those settings should be correctly read by application.properties
. We would probably need to see more dependencies being used in the project to understand.
Hi @falk-stefan perhaps you can share the full credentials file and maybe the bootstrap file (if there), so we can get a full picture.
Please do not share the full credentials file. That's supposed to stay a secret ;-)
Oh..my bad!...I should have said, the applications.properties
file and the bootstrap
file ;-)
Sorry for the late response. I was somehow able to make this work but I cannot tell what the problem really was. But it was definitely something on my side so I guess we can close this issue. Thank you!
Note that all other settings are working just fine.
I only recently adderd Spring Cloud GCP - it's the only piece that does not work as expected currently.
I am running a particular profile which points locally to a credentials file as follows:
If I run the same thing with
GOOGLE_APPLICATION_CREDENTIALS=/path/to/file/credentials.json
it's working.What am I missing?
I am using
spring-cloud-gcp-starter
(gradle):Update
It appears to be the same for other properties e.g. database name:
Debugging the code confirms that the properties are not getting set: