Describe the bug
azure-spring-boot-starter-keyvault-secrets has breaking (and wrongly documented) configuration properties.
Exception or Stack Trace
Calling this with a key vault which contains disabled secret is a good example that shows that :
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: java.lang.IllegalStateException: Failed to configure KeyVault property source
Caused by: com.azure.core.exception.ResourceModifiedException: Status code 403, "{"error":{"code":"Forbidden","message":"Operation get is not allowed on a disabled secret.","innererror":{"code":"SecretDisabled"}}}"
To Reproduce
Steps to reproduce the behavior:
property.yaml(!) file:yaml
azure:
keyvault:
allow:
telemetry: false
enabled: true
uri: https://${KEYVAULT_NAME}.vault.azure.net/
client-id: ${AZURE_CLIENT_ID}
client-key: ${KEYVAULT_CLIENT_SECRET:not-a-secret}
tenant-id: ${AZURE_TENANT}
secret:
keys: test1
test1 and disabled secret test2.*Setup
azure-spring-boot-starter-keyvault-secrets 2.3.3Expected behavior
Similar behaviour as in 2.2.X (as documented):
azure.keyvault.secret.keysis a property to indicate that if application using specific secret keys, if this property is set, application will only load the keys in the property and won't load all the keys from keyvault[...]
If you don't want to participate, just simply disable it by setting below configuration in application.properties.
azure.keyvault.allow.telemetry=false
→ Only test1 is fetched. No telemetry is sent.
Additional context
AZURE_KEYVAULT_SECRET_KEYS = "azure.keyvault.secret.keys"SECRET_KEYS("secret-keys"),Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Hi, @frank-fischer-by .
Thank you for reaching out.
IMU, secret-keys is more reasonable than secret.keys. Same to allow-telemetry.
Sorry for the breaking change.
And sorry for the non-updated document.
I have created a PR to fix the document;
Hi @chenrujun,
thanks for the update.
I'm fine either way - I just wondered about the inconsistency.
Now that I know what the correct values are I can just change the configuration 🙂.
Thanks for responding and acting so quickly 👍.
Regrading your PR: I think calling out the breaking change in the Changelog might help other people avoid it.
Hi, @frank-fischer-by .
I think calling out the breaking change in the Changelog might help other people avoid it.
It make sense. Thank you very much for your suggestion. 🙇