I want to load whole .properties file from GCP Secret Manager to my Spring Boot application.
Secret is "mounted as volume" in Cloud Run (whole .properties file, in path /secrets/secret.properties
), but I cannot manage to load it to Spring Boot using spring.config.import
I was trying:
spring.config.import=optional:configtree:/secrets/
spring.config.import=optional:classpath:/secrets/secret.properties
spring.config.import=optional:/secrets/secret.properties
but nothing works. Values are not visible in Spring Boot application.
(java.lang.IllegalArgumentException: Could not resolve placeholder 'x' in value "${x}"
)
When putting file on resource classpath, everything works.