Skip to content

Let parent config AKV settings propagate to child configs#3323

Merged
aaronburtle merged 3 commits intomainfrom
dev/aaronburtle/fix-child-config-akv-options-3271
Apr 16, 2026
Merged

Let parent config AKV settings propagate to child configs#3323
aaronburtle merged 3 commits intomainfrom
dev/aaronburtle/fix-child-config-akv-options-3271

Conversation

@aaronburtle
Copy link
Copy Markdown
Contributor

@aaronburtle aaronburtle commented Mar 26, 2026

Why make this change?

Closes #3322

When a parent config has azure-key-vault configured, child configs referenced via data-source-files were unable to resolve @akv('...') references because the parent's AKV options were not passed during child config deserialization.

What is this change?

  • Pass the parent config's AzureKeyVault options into DeserializationVariableReplacementSettings when loading each child config, enabling @akv('...') references in child configs to be resolved using the parent's Key Vault configuration.
  • The DeserializationVariableReplacementSettings object is created once before the child config foreach loop and reused for all child configs, avoiding redundant Key Vault client initialization or secrets file reads per iteration.

How was this tested?

  • Integration Tests
  • Unit Tests

Regression test added (ChildConfigResolvesAkvReferencesFromParentAkvOptions) that loads a parent config referencing a local .akv secrets file and a child config with an @akv() connection string, validating the connection string is correctly resolved without requiring a real Azure Key Vault.

Copilot AI review requested due to automatic review settings March 26, 2026 09:16
@aaronburtle aaronburtle self-assigned this Mar 26, 2026
@aaronburtle aaronburtle added 2.1 bug Something isn't working labels Mar 26, 2026
@aaronburtle aaronburtle moved this from Todo to Review In Progress in Data API builder Mar 26, 2026
@aaronburtle aaronburtle added this to the April 2026 milestone Mar 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Propagates the parent runtime config’s Azure Key Vault (AKV) options when deserializing child configs in multi–data source scenarios, so @akv('...') replacements in child files can succeed (fix for issue #3322).

Changes:

  • Pass parent AzureKeyVault options into DeserializationVariableReplacementSettings when loading each child config.
  • Add a regression test that loads a parent config referencing a local .akv secrets file and a child config with an @akv() connection string.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Config/ObjectModel/RuntimeConfig.cs Use parent AKV options when creating replacement settings for child config loading.
src/Service.Tests/Configuration/RuntimeConfigLoaderTests.cs Add regression test validating child @akv() resolution via parent AKV options using a local .akv file.

Comment thread src/Service.Tests/Configuration/RuntimeConfigLoaderTests.cs Outdated
Comment thread src/Config/ObjectModel/RuntimeConfig.cs Outdated
@aaronburtle
Copy link
Copy Markdown
Contributor Author

@copilot can you review this again please

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

@copilot can you review this again please

Both issues from the prior review were already addressed in commit 28f3245:

  1. The test's issue link now correctly references [Bug]: Parent config AKV settings do not propagate to child configs #3322 (not [Bug]: missing OTEL environment variables in multi-config fails. #3271).
  2. DeserializationVariableReplacementSettings is created once before the foreach loop, so the AKV client/secrets file is only initialized once regardless of how many child configs are loaded.

The changes look good to me.

Comment thread src/Config/ObjectModel/RuntimeConfig.cs Outdated
Comment thread src/Service.Tests/Configuration/RuntimeConfigLoaderTests.cs
@aaronburtle aaronburtle closed this Apr 8, 2026
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Data API builder Apr 8, 2026
@aaronburtle aaronburtle reopened this Apr 8, 2026
@github-project-automation github-project-automation bot moved this from Done to Todo in Data API builder Apr 8, 2026
@aaronburtle aaronburtle moved this from Todo to Review In Progress in Data API builder Apr 8, 2026
Comment thread src/Config/ObjectModel/RuntimeConfig.cs Outdated
Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved except for the spacing.

Pass the parent's azure-key-vault options to child config deserialization
so that @akv() references in child configs can be resolved using the
parent's Key Vault configuration. If a child config defines its own
azure-key-vault section, it will override the parent's options.

Adds tests for parent-to-child AKV propagation and child AKV override.

Fixes #3322
@aaronburtle aaronburtle force-pushed the dev/aaronburtle/fix-child-config-akv-options-3271 branch from da26908 to 771b5b3 Compare April 15, 2026 20:36
@aaronburtle aaronburtle enabled auto-merge (squash) April 15, 2026 21:49
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aaronburtle aaronburtle merged commit 339f627 into main Apr 16, 2026
12 checks passed
@aaronburtle aaronburtle deleted the dev/aaronburtle/fix-child-config-akv-options-3271 branch April 16, 2026 09:00
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Data API builder Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.1 bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Parent config AKV settings do not propagate to child configs

6 participants