Azure key vault property source force refresh
I am using spring boot with azure's keyvault
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-keyvault-secrets</artifactId>
</dependency>
but there is a problem, when I want to update secret. How to force for example via rest api lets say, refresh of this value ?
@Value("${x-value}") private val xValue: String = "0"
thanks!
Hi, @maciejbak85 .
Thanks for reaching out.
Now azure-spring-boot-starter-keyvault-secrets does not have the feature of update manually.
We will consider whether we need to provide this feature, and how to provide this feature.
Now you can use spring.cloud.azure.keyvault.secret.property-sources[].refresh-interval to set auto refresh interval. The default value is 30 minutes.
Reference: https://microsoft.github.io/spring-cloud-azure/4.0.0-beta.3/4.0.0-beta.3/reference/html/index.html#configuration-4
FYI, the Spring Cloud Azure 4.0 has been GAed. https://microsoft.github.io/spring-cloud-azure/current/reference/html/index.html
@chenrujun I am facing the same issue in the latest 4.3.0 version as well. I have setup the refresh interval for azure keyvault and I have observed that the latest secret versions are fetched as per the Refresh interval. But the issue is with the environment, While I am trying to access the environment.getProperty(), I still observe the old value. It is not refreshed in the environment somehow.
I believe the issue is with the usage of CachingDelegateEncryptablePropertySource in the environment property for azure keyvault secrets. I believe the cache used by the propertySource is not refreshed.
@sy185109
When you execute environment.getProperty("text"), you can add a breakpoint here: https://github.com/Azure/azure-sdk-for-java/blob/spring-cloud-azure-autoconfigure_4.3.0/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/environment/KeyVaultOperation.java#L108-L110
Check whether the value is updated in KeyVaultOperation.
@sy185109 are u suing this https://github.com/ulisesbocchio/jasypt-spring-boot?
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
@sy185109 are u suing this https://github.com/ulisesbocchio/jasypt-spring-boot?
Yes, I am using this library.
Hi @maciejbak85, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.