I'm using spring boot version 2.4.4 and spring.cloud.starter-vault-config=3.0.0
When I define authentication method as APPROLE in bootstrap.properties by enabling legacy bootstrap configuration property spring.cloud.bootstrap.enabled=true. It still ask me for vault token.
I knew that bootstrap.properties is now legacy affair then how to map secrets read from vault to datasource property.
During experiment I found that datasource bean get's created before vault bean hence couldn't map the credentails that are fetched from the vault.
I'm using spring boot version 2.4.4 and
spring.cloud.starter-vault-config=3.0.0
When I define authentication method as APPROLE in bootstrap.properties by enabling legacy bootstrap configuration propertyspring.cloud.bootstrap.enabled=true.
It still ask me for vault token.Error Log : Vault token must not be empty
this is my bootstrap.properties configuration.
spring.cloud.vault.host=<url>
spring.cloud.vault.port= <port>
spring.cloud.vault.scheme= https
spring.cloud.vault.kv-version= 2
spring.cloud.vault.namespace= <namespace_name>
spring.cloud.vault.authentication= APPROLE
spring.cloud.vault.app-role.role-id= <role_id>
spring.cloud.vault.app-role.role=<role>
spring.cloud.vault.authentication.app-role.app-role-path= <role_path>
spring.cloud.vault.app-role.secret-id=<secret_id>
spring.cloud.vault.generic.enabled = true
spring.config.import = vault://<mount_path_at_vault>
`Also,
I knew that bootstrap.properties is now legacy affair then how to map secrets read from vault to datasource property. During experiment I found that datasource bean get's created before vault bean hence couldn't map the credentails that are fetched from the vault.