Version: azure+app-configuration-provider@2.4.0
We have the following structure in Azure App Configuration:
apiCarts_markets: { "allCountryUrls": {"gb": {...}, "dk": {...}, ...}
apiCarts_markets.markets.dk: { ... }
apiCarts_markets.markets.gb: { ... }
apiCarts_markets.markets.fi: { ... }
....
When we load our function app we perform an initialise and load the settings like so:
settings = await load(APP_CONFIG_ENDPOINT, credential, {
refreshOptions: {
enabled: true,
refreshIntervalInMs: APP_CONFIG_REFRESH_INTERVAL_MS,
},
keyVaultOptions: {
credential,
parallelSecretResolutionEnabled: true,
secretRefreshIntervalInMs: APP_CONFIG_SECRET_REFRESH_INTERVAL_MS,
clientOptions: {
userAgentOptions: {
userAgentPrefix: `service/${getServiceName()}`,
},
},
},
clientOptions: {
userAgentOptions: {
userAgentPrefix: `service/${getServiceName()}`,
},
},
selectors: [
{
keyFilter: `apiCarts_*`,
},
],
trimKeyPrefixes: ["apiCarts_"],
})
settingsObject = settings.constructConfigurationObject({
separator: '.',
})
settingsObject correctly reads and resolves our App Configuration.
We then preserve this settings object in another module and call settingsObject.refresh() every minute
We have also setup a refresh callback: (Which should only be called when APP_CONFIG_REFRESH_INTERVAL_MS elapses and there are actual changes in the AppConfig)
And call constructConfigurationObject on the same settings object
(This is just pseudocode for demonstration purposes, ignore variable scoping issues etc..)
settingsObject.onRefresh(() => {
newSettingsObject = settingsObject.constructConfigurationObject({
separator: '.',
})
}
We are seeing this error come up only when we call constructConfigurationObject() after a ssettingsObject.refresh()
Initial load of constructConfigurationObject() works fine.
InvalidOperationError: Ambiguity occurs when constructing configuration object from key 'markets.markets.dk', value '[object Object]'. The key should not be part of another key.
at Rk.constructConfigurationObject (/node_modules/.pnpm/@azure+app-configuration-provider@2.4.0/node_modules/@azure/app-configuration-provider/src/appConfigurationImpl.ts:334:23)
Version: azure+app-configuration-provider@2.4.0
We have the following structure in Azure App Configuration:
When we load our function app we perform an initialise and load the settings like so:
settingsObject correctly reads and resolves our App Configuration.
We then preserve this settings object in another module and call settingsObject.refresh() every minute
We have also setup a refresh callback: (Which should only be called when APP_CONFIG_REFRESH_INTERVAL_MS elapses and there are actual changes in the AppConfig)
And call constructConfigurationObject on the same settings object
(This is just pseudocode for demonstration purposes, ignore variable scoping issues etc..)
We are seeing this error come up only when we call
constructConfigurationObject()after a ssettingsObject.refresh()Initial load of constructConfigurationObject() works fine.