Skip to content

[FEATURE REQ] Allow using our own SecretClient bean in KeyVaultEnvironmentPostProcessor #29651

Description

@nagyesta

Is your feature request related to a problem? Please describe.
I have tried to use the KeyVaultEnvironmentPostProcessor with a local test double and started to wonder whether I am doing it wrong or it is not possible to configure how the SecretClient is created (or use my own bean instead of creating a new one).
The SecretClientBuilderFactory is using only the bare minimum default configuration here as I understood. It is a bit confusing as I have assumed this bean will be reused from AzureKeyVaultSecretAutoConfiguration.

Describe the solution you'd like
Could we please provide our own SecretClient instance to the KeyVaultEnvironmentPostProcessor as an option?

Describe alternatives you've considered
If there would be a simple way to at least override the method and use a subclass that could be helpful as well, but it has package visibility now.

Additional context
In case we need to customize the SecretClient (for example a custom TokenCredential implementation needs to be used etc.) then it is not possible to do it as far as I see without hacking the KeyVaultEnvironmentPostProcessor. In my case, I would love to use a local test double for development and only use the real Key Vault in test/prod environments.

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

  • Description Added
  • Expected solution specified

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesazure-spring-keyvaultSpring keyvault related issues.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions