Add Azure Key Vault configuration support with object model, schema, and CLI options #2734
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive Azure Key Vault configuration support for Data API Builder, enabling users to configure Key Vault settings for secret management through both configuration files and CLI commands.
Changes Made
1. Object Model Classes
AzureKeyVaultOptions
: Top-level configuration class with endpoint and retry policyRetryPolicyOptions
: Detailed retry configuration with mode, counts, delays, and timeoutsRetryPolicyMode
: Enum supportingFixed
andExponential
retry modesRuntimeConfig
to include the newAzureKeyVault
property2. JSON Schema Updates
Added
azure-key-vault
section todab.draft.schema.json
with:endpoint
property (string)retry-policy
object with configurable propertiesexponential
, max-count=3
, delay-seconds=1
, max-delay-seconds=60
, network-timeout-seconds=60
max-delay-seconds
is only valid for exponential mode3. CLI Integration
Added 6 new CLI options following DAB naming conventions:
--azure-key-vault.endpoint
: Configure Key Vault endpoint URL--azure-key-vault.retry-policy.mode
: Set retry mode (fixed/exponential)--azure-key-vault.retry-policy.max-count
: Maximum retry attempts--azure-key-vault.retry-policy.delay-seconds
: Initial delay between retries--azure-key-vault.retry-policy.max-delay-seconds
: Maximum delay for exponential backoff--azure-key-vault.retry-policy.network-timeout-seconds
: Network timeout duration4. Configuration Processing
ConfigGenerator
withTryUpdateConfiguredAzureKeyVaultOptions
methodExample Usage
Configuration Example
Testing
Fixes #2733.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
test
/usr/lib/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/data-api-builder/data-api-builder/src/out/tests/net8.0/Azure.DataApiBuilder.Service.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/data-api-builder/data-api-builder/src/out/tests/net8.0/Azure.DataApiBuilder.Service.Tests.deps.json /home/REDACTED/work/data-api-builder/data-api-builder/src/out/tests/net8.0/testhost.dll --port 37677 --endpoint 127.0.0.1:037677 --role client --parentprocessid 4197 --telemetryoptedin false
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.