I have a Spring-boot based micro-service which is getting the database URL and credentials from GCP secret manager. I was able to run the service on my local and the secrets were being fetched from GCP secret manager without any error. I have also configured circleCI to deploy the application to GCP portal. But during the deployment, I can see that the service is not fetching the secrets fro Secret manager but instead trying to use the provided strings as username and password. My application.properties file looks like following:-
spring.cloud.gcp.secretmanager.enabled=true
spring.config.import=sm://
server.port=8000
spring.datasource.url=jdbc:postgresql://${sm://projects/sandbox-dev-rotw-316c/secrets/ms-java-database-host-dev}:5432/postgres
spring.datasource.username=${sm://projects/sandbox-dev-rotw-316c/secrets/ms-java-database-username-dev}
spring.datasource.password=${sm://projects/sandbox-dev-rotw-316c/secrets/ms-java-database-password-dev}
spring.datasource.driver-class-name=org.postgresql.Driver
Any reason why this would work on local and not on GCP portal?