Reputation: 2679
I am trying to make working hashicorp vault deployed on azure's AKS cluster with spring boot. I tried code from this blog post: blog post which works fine, but when I will change versions for:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
from
2.3.12.RELEASE
to
2.6.4
and
<spring-cloud.version>Hoxton.SR12</spring-cloud.version>
from
Hoxton.SR12
to
2021.0.1
then it stops to work, I dont see any errors in logs, but it returns me null's instead of values. Ive only updated dependencies there. Not sure what breaking changes were between. Can someone help me with this ?
thanks!
Upvotes: 0
Views: 3367
Reputation: 60
As a short-term fix, try adding dependency org.springframework.cloud:spring-cloud-starter-bootstrap.
The bootstrap.properties from spring boot 2.3 and earlier was deprecated in spring boot 2.4. The dependency above brings back the previous behaviour. Here is a relevant highlight from the documentation:
With Spring Cloud Vault 3.0 and Spring Boot 2.4, the bootstrap context initialization (bootstrap.yml, bootstrap.properties) of property sources was deprecated. Instead, Spring Cloud Vault favors Spring Boot’s Config Data API which allows importing configuration from Vault. With Spring Boot Config Data approach, you need to set the spring.config.import property in order to bind to Vault. You can read more about it in the Config Data Locations section. You can enable the bootstrap context either by setting the configuration property spring.cloud.bootstrap.enabled=true or by including the dependency org.springframework.cloud:spring-cloud-starter-bootstrap.
https://docs.spring.io/spring-cloud-vault/docs/current/reference/html/#client-side-usage
Upvotes: 1