I am deploying an app in PCF and I'm using the 2.4.4 starter parent. I bound an instance the Spring Cloud Config Server and CredHub services to the application. I have the following in the application-MY-PROFILE.yml (whthin the config repo used by Spring Cloud Config Server) :
spring:
datasource:
url: URL_TO_DATASOURCE
username: DATASORCE_USERNAME
password: ${vcap.services.CREDHUB_INSTANCE_NAME.credentials.datasource.password} # I have datasource.password in CredHub
This is my pom.xml:
```<?xml version="1.0" encoding="UTF-8"?>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
The problem is that the **spring.datasource.password** resolves to **${vcap.services.CREDHUB_INSTANCE_NAME.credentials.datasource.password}** instead of the actual password value from CredHub.
I have tried to bound **${vcap.services.CREDHUB_INSTANCE_NAME.credentials.datasource.password}** directly to a `@Value` in a `RestController `and that way I can see the actual value. So it seems that it only doesn't work if I refer to it from an .yml file. Also I am certain that the other properties from **application-MY-PROFILE.yml** are available in the configuration environment because I can see **spring.datasource.username** or **spring.datasource.url**.
I was using the 2.2.6.RELEASE starter before this upgrade and it was working fine. Am I doing something wrong or could this be an issue with Spring Boot?
<!--
Thanks for raising a Spring Boot issue. Please take the time to review the following
categories as some of them do not apply here.
π
"Please DO NOT Raise an Issue" Cases
- Question
STOP!! Please ask questions about how to use something, or to understand why something isn't
working as you expect it to, on Stack Overflow using the spring-boot tag.
- Security Vulnerability
STOP!! Please don't raise security vulnerabilities here. Head over to https://spring.io/security-policy to learn how to disclose them responsibly.
- Managed Dependency Upgrade
You DO NOT need to raise an issue for a managed dependency version upgrade as there's a semi-automatic process for checking managed dependencies for new versions before a release. BUT pull requests for upgrades that are more involved than just a version property change are still most welcome.
- With an Immediate Pull Request
An issue will be closed as a duplicate of the immediate pull request, so you don't have to raise an issue if you plan to create a pull request immediately.
π Bug report (please don't include this emoji/text, just add your details)
Please provide details of the problem, including the version of Spring Boot that you
are using. If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
π Enhancement (please don't include this emoji/text, just add your details)
Please start by describing the problem that you are trying to solve. There may already
be a solution, or there may be a way to solve it that you hadn't considered.
TIP: You can always edit your issue if it isn't formatted correctly.
See https://guides.github.com/features/mastering-markdown
-->
**Comment From: wilkinsona**
Thanks for the report. This issue is somewhat similar to #20614. Can you please review the advice in [this comment](https://github.com/spring-projects/spring-boot/issues/20614#issuecomment-603434517) and share the output of the `/actuator/env` endpoint with us?
**Comment From: Vladg90**
{ "activeProfiles": [ "test", "cloud" ], "propertySources": [ { "name": "server.ports", "properties": { "local.server.port": { "value": 8080 } } }, { "name": "management.endpoint.env.keys-to-sanitize", "properties": { "management.endpoint.env.keys-to-sanitize": { "value": ".credentials.,password,vcap_services,secret,key,token" } } }, { "name": "bootstrapProperties-configClient", "properties": {} }, { "name": "bootstrapProperties-credhub-app-service-test-master", "properties": {} }, { "name": "bootstrapProperties-credhub-app-service-cloud-master", "properties": {} }, { "name": "bootstrapProperties-ssh://mirror@NOT_SHARED:22/var/vcap/store/mirror/NOT_SHARED/application-config/app-service/application-test.yml", "properties": { "spring.datasource.url": { "value": "NOT_SHARED" }, "spring.datasource.username": { "value": "NOT_SHARED" }, "spring.datasource.password": { "value": "**" }, "spring.security.user.password": { "value": "*" }, "employee.edge.router.jwk.url": { "value": "NOT_SHARED" }, "search.service.endpoint": { "value": "NOT_SHARED" }, "search.service.auth.username": { "value": "NOT_SHARED" }, "search.service.auth.password": { "value": "" }, "some-companyemployeeaccount.service.endpoint": { "value": "NOT_SHARED" }, "some-companyemployeeaccount.service.auth.username": { "value": "NOT_SHARED" }, "some-companyemployeeaccount.service.auth.password": { "value": "" }, "organisationunit.service.endpoint": { "value": "NOT_SHARED" }, "organisationunit.service.auth.username": { "value": "NOT_SHARED" }, "organisationunit.service.auth.password": { "value": "" }, "uniqueclient.service.endpoint": { "value": "NOT_SHARED" }, "uniqueclient.service.version": { "value": 4.4 }, "logging.level.root": { "value": "info" } } }, { "name": "vcap", "properties": { "vcap.services.my-feature-credhub.provider": { "value": "" }, "vcap.application.space_name": { "value": "my-feature-space" }, "vcap.services.app-short-name-db-credhub-test.credentials.datasource.password": { "value": "" }, "vcap.services.my-feature-credhub.credentials.app-short-name.security.password": { "value": "" }, "vcap.services.my-feature-credhub.tags": { "value": "credhub" }, "vcap.application.cf_api": { "value": "https://api.sys.pcf-t02-we.some-company.nl" }, "vcap.application.uris[0]": { "value": "demo-upgrade.apps.pcf-t02-we.some-company.nl" }, "vcap.services.my-feature-credhub.credentials.ssl.key-password": { "value": "" }, "vcap.services.my-feature-credhub.credentials.app-short-name.organisationunitservice.auth.password": { "value": "" }, "vcap.application.application_id": { "value": "29a4c9bd-eb77-4385-96fd-45f52bc6b4e3" }, "vcap.application.application_name": { "value": "sprin-boot-upgrade-test" }, "vcap.services.my-feature-credhub.plan": { "value": "default" }, "vcap.services.app-short-name-db-credhub-test.provider": { "value": "" }, "vcap.application.application_uris": { "value": "demo-upgrade.apps.pcf-t02-we.some-company.nl" }, "vcap.services.my-feature-configuration-server.credentials.uri": { "value": "" }, "vcap.application.port": { "value": "8080" }, "vcap.services.app-short-name-db-credhub-test.syslog_drain_url": { "value": "" }, "vcap.application.name": { "value": "sprin-boot-upgrade-test" }, "vcap.application.uris": { "value": "demo-upgrade.apps.pcf-t02-we.some-company.nl" }, "vcap.application.limits.disk": { "value": "1024" }, "vcap.application.limits.fds": { "value": "16384" }, "vcap.services.my-feature-credhub.credentials.app-short-name.searchservice.auth.password": { "value": "" }, "vcap.services.app-short-name-db-credhub-test.binding_name": { "value": "" }, "vcap.services.my-feature-credhub.label": { "value": "credhub" }, "vcap.services.my-feature-credhub.tags[0]": { "value": "credhub" }, "vcap.application.organization_id": { "value": "4e914a47-7029-498a-992d-ac6524f1cf17" }, "vcap.services.app-short-name-db-credhub-test.label": { "value": "credhub" }, "vcap.services.my-feature-configuration-server.volume_mounts": { "value": "" }, "vcap.services.app-short-name-db-credhub-test.tags": { "value": "credhub" }, "vcap.services.my-feature-credhub.credentials.app-short-name.some-companyemployeeaccountservice.auth.password": { "value": "" }, "vcap.services.my-feature-configuration-server.label": { "value": "p.config-server" }, "vcap.application.version": { "value": "3b511eb9-e9f9-4c3d-8a51-2a2564789e05" }, "vcap.services.my-feature-credhub.syslog_drain_url": { "value": "" }, "vcap.application.host": { "value": "0.0.0.0" }, "vcap.services.my-feature-configuration-server.tags[1]": { "value": "spring-cloud" }, "vcap.services.my-feature-configuration-server.syslog_drain_url": { "value": "" }, "vcap.services.my-feature-configuration-server.provider": { "value": "" }, "vcap.application.organization_name": { "value": "fm-org" }, "vcap.services.my-feature-configuration-server.name": { "value": "my-feature-configuration-server" }, "vcap.application.limits.mem": { "value": "768" }, "vcap.application.instance_id": { "value": "74548ff4-47a2-44b3-747a-8ce7" }, "vcap.services.my-feature-configuration-server.credentials.access_token_uri": { "value": "" }, "vcap.services.app-short-name-db-credhub-test.name": { "value": "app-short-name-db-credhub-test" }, "vcap.services.app-short-name-db-credhub-test.tags[0]": { "value": "credhub" }, "vcap.application.application_uris[0]": { "value": "demo-upgrade.apps.pcf-t02-we.some-company.nl" }, "vcap.services.my-feature-credhub.volume_mounts": { "value": "" }, "vcap.services.app-short-name-db-credhub-test.instance_name": { "value": "app-short-name-db-credhub-test" }, "vcap.services.my-feature-credhub.binding_name": { "value": "" }, "vcap.application.process_type": { "value": "web" }, "vcap.application.space_id": { "value": "NOT_SHARED" }, "vcap.services.my-feature-configuration-server.tags": { "value": "configuration,spring-cloud" }, "vcap.application.instance_index": { "value": "0" }, "vcap.services.my-feature-credhub.instance_name": { "value": "my-feature-credhub" }, "vcap.services.my-feature-configuration-server.tags[0]": { "value": "configuration" }, "vcap.services.my-feature-configuration-server.instance_name": { "value": "my-feature-configuration-server" }, "vcap.application.application_version": { "value": "3b511eb9-e9f9-4c3d-8a51-2a2564789e05" }, "vcap.services.my-feature-configuration-server.credentials.client_id": { "value": "" }, "vcap.services.my-feature-configuration-server.plan": { "value": "standard" }, "vcap.application.process_id": { "value": "29a4c9bd-eb77-4385-96fd-45f52bc6b4e3" }, "vcap.services.app-short-name-db-credhub-test.plan": { "value": "default" }, "vcap.services.my-feature-configuration-server.credentials.client_secret": { "value": "" }, "vcap.services.app-short-name-db-credhub-test.volume_mounts": { "value": "" }, "vcap.services.my-feature-configuration-server.binding_name": { "value": "" }, "vcap.services.my-feature-credhub.credentials.ssl.trust-password": { "value": "" }, "vcap.services.my-feature-credhub.name": { "value": "my-feature-credhub" } } }, { "name": "springCloudServicesRabbitAutoconfigExcluder", "properties": { "spring.autoconfigure.exclude": { "value": "org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration" } } }, { "name": "springCloudServicesConfigServer", "properties": { "spring.cloud.config.uri": { "value": "https://config-server-NOT_SHARED.apps.pcf-t02-we.some-company.nl" }, "spring.cloud.config.client.oauth2.clientId": { "value": "config-client-NOT_SHARED" }, "spring.cloud.config.client.oauth2.clientSecret": { "value": "" }, "spring.cloud.config.client.oauth2.accessTokenUri": { "value": "https://uaa.sys.pcf-t02-we.some-company.nl:443/oauth/token" } } }, { "name": "servletContextInitParams", "properties": {} }, { "name": "systemProperties", "properties": { "awt.toolkit": { "value": "sun.awt.X11.XToolkit" }, "java.specification.version": { "value": "11" }, "sun.cpu.isalist": { "value": "" }, "sun.jnu.encoding": { "value": "UTF-8" }, "java.class.path": { "value": "/home/vcap/app/.:/home/vcap/app/.java-buildpack/container_security_provider/container_security_provider-1.18.0_RELEASE.jar" }, "java.vm.vendor": { "value": "BellSoft" }, "sun.arch.data.model": { "value": "64" }, "java.vendor.url": { "value": "https://bell-sw.com/" }, "catalina.useNaming": { "value": "false" }, "user.timezone": { "value": "Europe/Amsterdam" }, "os.name": { "value": "Linux" }, "java.vm.specification.version": { "value": "11" }, "sun.java.launcher": { "value": "SUN_STANDARD" }, "user.country": { "value": "US" }, "sun.boot.library.path": { "value": "/home/vcap/app/.java-buildpack/open_jdk_jre/lib" }, "sun.java.command": { "value": "org.springframework.boot.loader.JarLauncher" }, "jdk.debug": { "value": "release" }, "sun.cpu.endian": { "value": "little" }, "user.home": { "value": "/home/vcap" }, "user.language": { "value": "en" }, "java.specification.vendor": { "value": "Oracle Corporation" }, "java.security.properties": { "value": "/home/vcap/app/.java-buildpack/java_security/java.security" }, "java.version.date": { "value": "2021-01-19" }, "java.home": { "value": "/home/vcap/app/.java-buildpack/open_jdk_jre" }, "file.separator": { "value": "/" }, "java.vm.compressedOopsMode": { "value": "32-bit" }, "line.separator": { "value": "\n" }, "java.specification.name": { "value": "Java Platform API Specification" }, "java.vm.specification.vendor": { "value": "Oracle Corporation" }, "FILE_LOG_CHARSET": { "value": "UTF-8" }, "java.awt.graphicsenv": { "value": "sun.awt.X11GraphicsEnvironment" }, "java.awt.headless": { "value": "true" }, "sun.management.compiler": { "value": "HotSpot 64-Bit Tiered Compilers" }, "java.runtime.version": { "value": "11.0.10+9-LTS" }, "user.name": { "value": "vcap" }, "path.separator": { "value": ":" }, "os.version": { "value": "4.15.0-136-generic" }, "java.runtime.name": { "value": "OpenJDK Runtime Environment" }, "file.encoding": { "value": "UTF-8" }, "spring.beaninfo.ignore": { "value": "true" }, "java.vm.name": { "value": "OpenJDK 64-Bit Server VM" }, "java.vendor.url.bug": { "value": "https://bell-sw.com/support" }, "java.io.tmpdir": { "value": "/home/vcap/tmp" }, "catalina.home": { "value": "/home/vcap/tmp/tomcat.8080.7873322507278565449" }, "java.version": { "value": "11.0.10" }, "user.dir": { "value": "/home/vcap/app" }, "os.arch": { "value": "amd64" }, "java.vm.specification.name": { "value": "Java Virtual Machine Specification" }, "PID": { "value": "30" }, "java.awt.printerjob": { "value": "sun.print.PSPrinterJob" }, "sun.os.patch.level": { "value": "unknown" }, "CONSOLE_LOG_CHARSET": { "value": "UTF-8" }, "catalina.base": { "value": "/home/vcap/tmp/tomcat.8080.7873322507278565449" }, "java.library.path": { "value": "/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib" }, "java.vm.info": { "value": "mixed mode" }, "java.vendor": { "value": "BellSoft" }, "java.vm.version": { "value": "11.0.10+9-LTS" }, "sun.io.unicode.encoding": { "value": "UnicodeLittle" }, "java.ext.dirs": { "value": "" }, "java.class.version": { "value": "55.0" } } }, { "name": "systemEnvironment", "properties": { "PATH": { "value": "/usr/local/bin:/usr/bin:/bin", "origin": "System Environment Property \"PATH\"" }, "VCAP_APP_HOST": { "value": "0.0.0.0", "origin": "System Environment Property \"VCAP_APP_HOST\"" }, "COMPANYPCF_SYSTEM_ENV": { "value": "t02", "origin": "System Environment Property \"COMPANYPCF_SYSTEM_ENV\"" }, "TZ": { "value": "Europe/Amsterdam", "origin": "System Environment Property \"TZ\"" }, "SPRING_PROFILES_ACTIVE": { "value": "test", "origin": "System Environment Property \"SPRING_PROFILES_ACTIVE\"" }, "INSTANCE_INDEX": { "value": "0", "origin": "System Environment Property \"INSTANCE_INDEX\"" }, "COMPANYPCF_LOCALDOMAIN": { "value": "apps.pcf-t02-we.some-company.nl", "origin": "System Environment Property \"COMPANYPCF_LOCALDOMAIN\"" }, "LANG": { "value": "en_US.UTF-8", "origin": "System Environment Property \"LANG\"" }, "JBP_CONFIG_OPEN_JDK_JRE": { "value": "{ jre: { version: 11.+ } }", "origin": "System Environment Property \"JBP_CONFIG_OPEN_JDK_JRE\"" }, "CF_INSTANCE_PORTS": { "value": "[{\"external\":61052,\"internal\":8080,\"external_tls_proxy\":61054,\"internal_tls_proxy\":61001},{\"external\":61053,\"internal\":2222,\"external_tls_proxy\":61055,\"internal_tls_proxy\":61002}]", "origin": "System Environment Property \"CF_INSTANCE_PORTS\"" }, "CF_SYSTEM_CERT_PATH": { "value": "/etc/cf-system-certificates", "origin": "System Environment Property \"CF_SYSTEM_CERT_PATH\"" }, "CF_INSTANCE_GUID": { "value": "74548ff4-47a2-44b3-747a-8ce7", "origin": "System Environment Property \"CF_INSTANCE_GUID\"" }, "CF_INSTANCE_KEY": { "value": "", "origin": "System Environment Property \"CF_INSTANCE_KEY\"" }, "PWD": { "value": "/home/vcap/app", "origin": "System Environment Property \"PWD\"" }, "CF_INSTANCE_PORT": { "value": "61052", "origin": "System Environment Property \"CF_INSTANCE_PORT\"" }, "VCAP_APPLICATION": { "value": "{\"application_id\":\"NOT_SHARED\",\"application_name\":\"sprin-boot-upgrade-test\",\"application_uris\":[\"demo-upgrade.apps.pcf-t02-we.some-company.nl\"],\"application_version\":\"NOT_SHARED\",\"cf_api\":\"https://api.sys.pcf-t02-we.some-company.nl\",\"host\":\"0.0.0.0\",\"instance_id\":\"NOT_SHARED\",\"instance_index\":0,\"limits\":{\"disk\":1024,\"fds\":16384,\"mem\":768},\"name\":\"sprin-boot-upgrade-test\",\"organization_id\":\NOT_SHARED\",\"organization_name\":\"fm-org\",\"port\":8080,\"process_id\":\"NOT_SHARED\",\"process_type\":\"web\",\"space_id\":\"NOT_SHARED\",\"space_name\":\"my-feature-space\",\"uris\":[\"demo-upgrade.apps.pcf-t02-we.some-company.nl\"],\"version\":\"NOT_SHARED\"}", "origin": "System Environment Property \"VCAP_APPLICATION\"" }, "COMPANYPCF_LOCATION_SHORT": { "value": "we", "origin": "System Environment Property \"COMPANYPCF_LOCATION_SHORT\"" }, "SERVER_PORT": { "value": "8080", "origin": "System Environment Property \"SERVER_PORT\"" }, "CF_INSTANCE_IP": { "value": "NOT_SHARED", "origin": "System Environment Property \"CF_INSTANCE_IP\"" }, "PORT": { "value": "8080", "origin": "System Environment Property \"PORT\"" }, "VCAP_SERVICES": { "value": "**", "origin": "System Environment Property \"VCAP_SERVICES\"" }, "COMPANYPCF_LOCATION": { "value": "westeurope", "origin": "System Environment Property \"COMPANYPCF_LOCATION\"" }, "INSTANCE_GUID": { "value": "NOT_SHARED", "origin": "System Environment Property \"INSTANCE_GUID\"" }, "OLDPWD": { "value": "/home/vcap", "origin": "System Environment Property \"OLDPWD\"" }, "USER": { "value": "vcap", "origin": "System Environment Property \"USER\"" }, "DEPS_DIR": { "value": "/home/vcap/deps", "origin": "System Environment Property \"DEPS_DIR\"" }, "VCAP_APP_PORT": { "value": "8080", "origin": "System Environment Property \"VCAP_APP_PORT\"" }, "TMPDIR": { "value": "/home/vcap/tmp", "origin": "System Environment Property \"TMPDIR\"" }, "CF_INSTANCE_ADDR": { "value": "10.253.20.132:61052", "origin": "System Environment Property \"CF_INSTANCE_ADDR\"" }, "CF_INSTANCE_INDEX": { "value": "0", "origin": "System Environment Property \"CF_INSTANCE_INDEX\"" }, "CF_INSTANCE_INTERNAL_IP": { "value": "10.255.86.192", "origin": "System Environment Property \"CF_INSTANCE_INTERNAL_IP\"" }, "MEMORY_LIMIT": { "value": "768m", "origin": "System Environment Property \"MEMORY_LIMIT\"" }, "CF_INSTANCE_CERT": { "value": "/etc/cf-instance-credentials/instance.crt", "origin": "System Environment Property \"CF_INSTANCE_CERT\"" }, "SHLVL": { "value": "0", "origin": "System Environment Property \"SHLVL\"" }, "HOME": { "value": "/home/vcap/app", "origin": "System Environment Property \"HOME\"" }, "MALLOC_ARENA_MAX": { "value": "2", "origin": "System Environment Property \"MALLOC_ARENA_MAX\"" } } }, { "name": "springCloudClientHostInfo", "properties": { "spring.cloud.client.hostname": { "value": "NOT_SHARED" }, "spring.cloud.client.ip-address": { "value": "NOT_SHARED" } } }, { "name": "Config resource 'class path resource [application.yml]' via location 'optional:classpath:/'", "properties": { "spring.application.name": { "value": "app-service", "origin": "class path resource [application.yml] - 4:11" }, "management.endpoints.web.exposure.include": { "value": "", "origin": "class path resource [application.yml] - 10:18" } } }, { "name": "Config resource 'class path resource [bootstrap.yml]' via location 'optional:classpath:/'", "properties": { "spring.cloud.config.enabled": { "value": true, "origin": "class path resource [bootstrap.yml] - 4:16" } } }, { "name": "springCloudDefaultProperties", "properties": {} }, { "name": "springCloudServicesBootstrap", "properties": { "spring.application.name": { "value": "sprin-boot-upgrade-test" } } }, { "name": "cloud", "properties": { "cloud.application.host": { "value": "0.0.0.0" }, "cloud.services.my-feature-configuration-server.id": { "value": "my-feature-configuration-server" }, "cloud.application.application_name": { "value": "sprin-boot-upgrade-test" }, "cloud.application.organization_name": { "value": "NOT_SHARED" }, "cloud.application.instance_index": { "value": 0 }, "cloud.application.cf_api": { "value": "NOT_SHARED" }, "cloud.services.my-feature-credhub.id": { "value": "my-feature-credhub" }, "cloud.services.app-short-name-db-credhub-test.id": { "value": "app-short-name-db-credhub-test" }, "cloud.application.application_id": { "value": "121212" }, "cloud.application.application_uris": { "value": "Complex property type java.util.ArrayList" }, "cloud.application.application_version": { "value": "232456" }, "cloud.application.port": { "value": 8080 }, "cloud.application.process_id": { "value": "NOT_SHARED" }, "cloud.application.uris": { "value": "Complex property type java.util.ArrayList" }, "cloud.application.name": { "value": "sprin-boot-upgrade-test" }, "cloud.application.app-id": { "value": "sprin-boot-upgrade-test" }, "cloud.application.instance_id": { "value": "NOT_SHARED" }, "cloud.application.version": { "value": "NOT_SHARED" }, "cloud.application.organization_id": { "value": "NOT_SHARED" }, "cloud.application.limits": { "value": "Complex property type java.util.LinkedHashMap" }, "cloud.application.process_type": { "value": "web" }, "cloud.application.instance-id": { "value": "12324" }, "cloud.application.space_name": { "value": "my-feature-space" }, "cloud.application.space_id": { "value": "123445" } } } ] }
^Had to replace some stuff because it's confidential.
"spring.datasource.password": { "value": "**" },
^ I can see this is obfuscated, so based on the output I can't tell from actuator/env if it's the correct value. As I mentioned in the issue description, I can see the correct value if I inject ${vcap.services.CREDHUB_INSTANCE.credentials.datasource.password} with a value annotation, but it doesn't seem to be replaced if I put it in the .yml, so it's a bit different from #20614 because in that situation the property couldn't be resolved at all.
**Comment From: wilkinsona**
Thank you. Can you please share the exact value of `spring.datasource.password` in your YAML file. I assume that it's `${vcap.services.app-short-name-db-credhub-test.credentials.datasource.password}` rather than `${vcap.services.CREDHUB_INSTANCE_NAME.credentials.datasource.password}` but I would like to know for certain.
**Comment From: Vladg90**
@wilkinsona Yes, I can confirm ${vcap.services.app-short-name-db-credhub-test.credentials.datasource.password} is the exact value in the YAML file.
**Comment From: wilkinsona**
Thanks. I've tried to reproduce this in a minimal manner, but haven't been able to do so. `DataSourceProperties.setPassword(String)` is called with the value of `vcap.services.app-short-name-db-credhub-test.credentials.datasource.password` as expected. There are a few moving parts in your description that may be playing a part. To help us to narrow down the possible causes of the problem, can you please experiment a little and see if the problem still occurs without them? For example, if you remove the use of a profile, does the problem still occur? Similarly does it occur if you take config server out of the picture?
**Comment From: Vladg90**
Seems like I had a total different issue. I am using the mssql-jdbc driver and it seems that the version that comes from Spring Boot dependency management (8.4.1.jre8) doesn't work when using ActiveDirectoryPassword authentication. I got authentication failure and this mislead me into thinking it was a problem with CredHub/Config server not being able to populate the credentials.
After trying different things I found out that this setup works:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>9.2.1.jre11</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>msal4j</artifactId>
<version>1.9.1</version>
</dependency>
However, this one doesn't:
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<!-- version ommited, solved by dependency management: 8.4.1.jre8 -->
</dependency>
``` But of course, this is a totally different problem, unrelated to the original topic of the issue.
Comment From: wilkinsona
Thanks for letting us know. That sounds like a bug or limitation in the SQL Server JDBC driver. We've upgraded to 9.2.x in Spring Boot 2.5 so I think we've done all that we can here. If there's a fix in the 8.4.x line of the driver we'll pick that up in due course in a Spring Boot 2.4.x maintenance release.