data-api-builder icon indicating copy to clipboard operation
data-api-builder copied to clipboard

Update variable replacement during deserialization to use replacement settings class and add AKV replacement logic.

Open aaronburtle opened this issue 4 months ago • 22 comments

Why make this change?

Adds AKV variable replacement and expands our design for doing variable replacements to be more extensible when new variable replacement logic is added.

Closes #2708 Closes #2748 Related to #2863

What is this change?

Change the way that variable replacement is handled to instead of simply using a bool to indicate that we want env variable replacement, we add a class which holds all of the replacement settings. This will hold whether or not we will do replacement for each kind of variable that we will handle replacement for during deserialization. We also include the replacement failure mode, and put the logic for handling the replacements into a strategy dictionary which pairs the replacement variable type with the strategy for doing that replacement.

Because Azure Key Vault secret replacement requires having the retry and connection settings in order to do the AKV replacement, we must do a first pass where we only do non-AKV replacement and get the required settings so that if AKV replacement is used we have the required settings to do that replacement.

We also have to keep in mind that the legacy of the Configuration Controller will ignore all variable replacement, so we construct the replacement settings for this code path to not use any variable replacement at all.

How was this tested?

We have updated the logic for the tests to use the new system, however manual testing using an actual AKV is still required.

Sample Request(s)

  • Example REST and/or GraphQL request to demonstrate modifications
  • Example of CLI usage to demonstrate modifications

aaronburtle avatar Sep 18 '25 01:09 aaronburtle

/azp run

Aniruddh25 avatar Oct 31 '25 23:10 Aniruddh25

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Oct 31 '25 23:10 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 05 '25 04:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 05 '25 04:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 06 '25 17:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 06 '25 17:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 06 '25 19:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 06 '25 19:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 06 '25 21:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 06 '25 21:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 06 '25 22:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 06 '25 22:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 06 '25 23:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 06 '25 23:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 07 '25 22:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 07 '25 22:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 07 '25 23:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 07 '25 23:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 12 '25 18:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 12 '25 18:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 12 '25 20:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 12 '25 20:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 17 '25 19:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 17 '25 19:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 18 '25 04:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 18 '25 04:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 18 '25 22:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 18 '25 22:11 azure-pipelines[bot]

/azp run

aaronburtle avatar Nov 18 '25 22:11 aaronburtle

Azure Pipelines successfully started running 6 pipeline(s).

azure-pipelines[bot] avatar Nov 18 '25 22:11 azure-pipelines[bot]