You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@env() executes before @akv(). So, azure-key-vault.endpoint can be set by @env().
For @akv('key-value'), "key-value" is the secret name.
Like @env() DAB supports @akv() for any config property.
Using @akv() requires either system-assigned or user-assigned managed identity.
The @akv() function works in both mode development and production.
The syntax @env('@akv('value')') is not supported and would look for an env named @akv('value').
However, the syntax @akv('@env('value')') is supported.
The DAB config does not monitor, listen to or poll AKV for secret changes. Requires restart.
Key rules (based on AKV docs)
Rule
Constraint
Allowed chars
Alphanumeric and - (hyphen)
Disallowed
No spaces, no _, /, @, ., etc.
Start/end
Must start and end with an alphanumeric character
Length
1 to 127 characters
Case
Case-insensitive (MySecret = mysecret)
Uniqueness
Must be unique within the Key Vault
Multiple configs
DAB supports multiple configuration files, where the top-level config is the master and others inherit runtime settings from it. Child configs define their own connection strings in the data-source property and may also have unique azure-key-vault.endpoint values. If a child omits the endpoint, it inherits the setting from the master config, which is required only if the child omits it.
Each config file can define a unique azure-key-vault.endpoint value.
If a child omits azure-key-vault.endpoint, it inherits from the master.
A child may use @akv() even if the master does not define an endpoint. However, in this case, the child configuration must define an endpoint value.
Consideration
Include an OTEL activity wrapping the replacement.
(would be nice) Include an OTEL activity wrapping the replacement for @env().
Errors
When @akv() appears without azure-key-vault.endpoint, we will log (as error) and fail to start.
When @akv() connection fails (for any reason), we will log the reason (as error) and fail to start.
When @akv() secret not found, we will log "secret not found: {property-name}" (as error) and fail to start.
When @akv() fails during hot reload, we will log "@akv error: {message}", then return to "last known good".
Flow
sequenceDiagram
actor Engine as Engine
participant ConfigInMem as ConfigInMem
participant Environment as Environment
participant AKV as AKV
participant Config as ConfigFile
Engine ->> Engine: Pre-Start
Engine ->> Config: Load Config
Config -->> Engine: Config Data
Engine ->> ConfigInMem: Create In-Memory Config
Note over Engine: Perform Config Replacements
activate Engine
ConfigInMem -->> Engine: Parse @env Values
Engine ->> Environment: Get
Environment -->> Engine: Values
Engine ->> ConfigInMem: Replace @env Values
deactivate Engine
Note over Engine: Use Config With ENV Replacements
activate Engine
ConfigInMem -->> Engine: Parse @akv Values
Engine ->> AKV: Request
AKV -->> Engine: Secrets
Engine ->> ConfigInMem: Replace @akv Values
deactivate Engine
Note over Engine: Use Config With AKV Replacements
Engine ->> Engine: Start
For developers who want their secrets in Azure Key Vault, support a syntax in the config that allows it.
Added properties
{ "azure-key-vault" : { "endpoint": "url", (string, required when @akv() is present) "retry-policy": { "mode": "fixed | exponential", (enum, default: exponential) "max-count": 3, (integer, default: 3) "delay-seconds": 1, (integer, default: 1) "max-delay-seconds": 100 (integer, default: 60), "network-timeout-seconds": 100 (integer, default: 60), } } }endpointretry-policy / modeexponentialretry-policy / max-count3(for both strategies)int.MaxValueretry-policy / delay-seconds1(for both strategies)int.MaxValueretry-policy / max-delay-seconds60(only forexponential)int.MaxValueretry-policy / network-timeout-seconds60int.MaxValueJSON Schema
Update our JSON schema. Add properties and constraints and defaults.
azure-key-vaultis not required.azure-key-vault.endpointis required whenazure-key-vaultis present.CLI updates
Add command line support.
dab configure --azure-key-vault.endpointdab configure --azure-key-vault.retry-policy.modedab configure --azure-key-vault.retry-policy.max-countdab configure --azure-key-vault.retry-policy.delay-secondsdab configure --azure-key-vault.retry-policy.max-delay-secondsdab configure --azure-key-vault.retry-policy.network-timeout-secondsAdded syntax
Support new
@akv()method to replace property values in our DAB configuration.{ "data-source": { "connection-string": "@akv('my-connection-string')" } }This works. Because
envruns first.{ "data-source": { "connection-string": "@akv('my-connection-string')" }, "azure-key-vault": { "endpoint": "@env('my-akv-endpoint')" } }Details
@env()executes before@akv(). So,azure-key-vault.endpointcan be set by@env().@akv('key-value'), "key-value" is the secret name.@env()DAB supports@akv()for any config property.@akv()requires either system-assigned or user-assigned managed identity.@akv()function works in both modedevelopmentandproduction.@env('@akv('value')')is not supported and would look for an env named@akv('value').@akv('@env('value')')is supported.Key rules (based on AKV docs)
-(hyphen)_,/,@,., etc.MySecret=mysecret)Multiple configs
DAB supports multiple configuration files, where the top-level config is the master and others inherit
runtimesettings from it. Child configs define their own connection strings in thedata-sourceproperty and may also have uniqueazure-key-vault.endpointvalues. If a child omits the endpoint, it inherits the setting from the master config, which is required only if the child omits it.azure-key-vault.endpointvalue.azure-key-vault.endpoint, it inherits from the master.@akv()even if the master does not define an endpoint. However, in this case, the child configuration must define an endpoint value.Consideration
activitywrapping the replacement.activitywrapping the replacement for@env().Errors
@akv()appears withoutazure-key-vault.endpoint, we will log (as error) and fail to start.@akv()connection fails (for any reason), we will log the reason (as error) and fail to start.@akv()secret not found, we will log "secret not found: {property-name}" (as error) and fail to start.@akv()fails during hot reload, we will log "@akv error: {message}", then return to "last known good".Flow