Closed venukbh closed 3 years ago
Thanks for bringing this up. Please check this issue #683 to see if it helps.
@saragluna Then what is the purpose of having this property in the code azure.keyvault.refresh-interval ? It was also mentioned on your portal which is quite deviating the actual functionality.
Hi @venukbh , if you want to get the value out of the key vault then you can access the Environment directly instead of using @Value, because @Value is resolved at the time the @Component is constructed and after that never updated (unless the entire ApplicationContext is restarted).
just an example:
@Autowired Environment environment;
And then use environment.getProperty(“propertyName”);
Besides, the property azure.keyvault.refresh-interval
is used to set the refresh interval how long the key vault values will be refreshed from the server, this property works when you do not specify the secrets to load from Key Vault by azure.keyvault.secret.keys
.
@yiliuTo In my above steps to reporduce, I did not any where used azure.keyvault.secret.keys
property. As per documentation, I agree that if I use azure.keyvault.secret.keys
, may be the keys will not refresh.
So, as you mentioned, will using Environment
help in refreshing the keys? or is it just a try you are suggesting?
Hi @venukbh , I have tried using Environment.getProperty()
and it calls the function KeyVaultOperation.get()
and KeyVaultOperation.getPropertyNames()
, which will refresh the keys if the requirements we discussed are met.
Closing this issue. Because it's not active for a long time. If anyone have similar issue, please create issue in new repo: https://github.com/Azure/azure-sdk-for-java/issues
Environment
Summary
Followed the steps mentioned on the page, and was able to read the keys from key-vault. Changed the refresh-interval to 2 minutes = 120000 milli seconds After app started, changed the values in azure key vault, and for every 2 minutes thereafter, verified to see the new value reflected. But I do not see the value being reflected. It is still using the old value.
Reproduce steps
Followed the steps mentioned on the page, and was able to read the keys from key-vault. Changed the refresh-interval to 2 minutes = 120000 milli seconds After app started, changed the values in azure key vault, and for every 2 minutes thereafter, verified to see the new value reflected. But I do not see the value being reflected. It is still using the old value.
These are the properties I am using
Here is the code
Expected Results
Get the updated key value from key vault
Actual Results
Always storing the initial loaded value and not refreshing the latest value.