Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Breaking changes in azure-spring-boot-starter-keyvault-secrets' configuration #15342

Closed
3 tasks done
ghost opened this issue Sep 17, 2020 · 3 comments · Fixed by #15359
Closed
3 tasks done

[BUG] Breaking changes in azure-spring-boot-starter-keyvault-secrets' configuration #15342

ghost opened this issue Sep 17, 2020 · 3 comments · Fixed by #15359
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-keyvault Spring keyvault related issues. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@ghost
Copy link

ghost commented Sep 17, 2020

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:

  • Create a property.yaml(!) file:
    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
  • Create enabled secret test1 and disabled secret test2.
  • Capture HTTP traffic intended for https://dc.services.visualstudio.com/v2/track
  • Run a spring boot app which simply fethes these properties

*Setup

  • OS: Linux
  • IDE : IntelliJ
  • azure-spring-boot-starter-keyvault-secrets 2.3.3

Expected behavior
Similar behaviour as in 2.2.X (as documented):

azure.keyvault.secret.keys is 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

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

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 17, 2020
@chenrujun chenrujun added azure-spring All azure-spring related issues azure-spring-keyvault Spring keyvault related issues. labels Sep 18, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Sep 18, 2020
@chenrujun chenrujun self-assigned this Sep 18, 2020
@chenrujun chenrujun linked a pull request Sep 18, 2020 that will close this issue
@chenrujun
Copy link

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;

@ghost
Copy link
Author

ghost commented Sep 18, 2020

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.

@chenrujun
Copy link

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. 🙇

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues azure-spring-keyvault Spring keyvault related issues. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant