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
{{ message }}
Repository navigation
Ambiguity occurs when constructing configuration object after a refresh() #286
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.
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)
Hi Zhiyuan Liang (@zhiyuanliang-ms) - for reference, we can see the error when there are no data changes. So presumably it'll pull down the same config again. We'll try and get you some more detail, but wanted to at least give you that specific detail asap.
I reproduced the issue. And this is a bug. I've identified the root cause: when constructConfigurationObject() builds the hierarchical object, it assigns parsed JSON values by reference rather than by copy. If another key shares the same prefix (e.g., "markets" and "markets.markets.dk"), the method inadvertently modifies the original stored value during the first call, which causes the second call to fail with an ambiguity error.
Activity
zhiyuanliang-ms commentedon Feb 26, 2026
Hey, Potter Rafed (@prafed)
Sorry for the inconvenience. Could you provide more information to help me reproduce the error?
I used the above code to reproduce the error.
In my app config store, there are three kvs:
All three kvs have content type:
application/json"apiCarts_markets" with value:
{ "gb": { "url": "https://api.example.com/gb-updated" }, "dk": { "url": "https://api.example.com/dk" } }"apiCarts_markets.markets.dk" with value:
{ "currency": "DKK" }"apiCarts_markets.markets.gb" with value:
{ "currency": "GBP" }I tried to modify the url and the currency. I also tried to add a new kv: "apiCarts_markets.markets.us".
But I didn't the get the error you got.
Could you share more information about how you update your kv in your App Config store?
jimmythomson commentedon Feb 26, 2026
Hi Zhiyuan Liang (@zhiyuanliang-ms) - for reference, we can see the error when there are no data changes. So presumably it'll pull down the same config again. We'll try and get you some more detail, but wanted to at least give you that specific detail asap.
Thanks.
jimmythomson commentedon Feb 26, 2026
I think that you can effectively replicate the error by calling
constructConfigurationObjecttwice:I appreciate that you wouldn't ordinarily expect two calls like this, but should that cause an error?
zhiyuanliang-ms commentedon Feb 27, 2026
Hey, Jimmy Thomson (@jimmythomson)
I reproduced the issue. And this is a bug. I've identified the root cause: when
constructConfigurationObject()builds the hierarchical object, it assigns parsed JSON values by reference rather than by copy. If another key shares the same prefix (e.g., "markets" and "markets.markets.dk"), the method inadvertently modifies the original stored value during the first call, which causes the second call to fail with an ambiguity error.Fixed in #288
jimmythomson commentedon Feb 27, 2026
Thanks very much for the quick turnaround Zhiyuan Liang (@zhiyuanliang-ms) - we'll update the package version once released and test it out.
prafed commentedon Mar 23, 2026
Thanks for this! Any news on when this will be released?
zhiyuanliang-ms commentedon Mar 24, 2026
Hey, Potter Rafed (@prafed)
We planed a release this week.
linglingye001 commentedon Mar 27, 2026
Hi Potter Rafed (@prafed) , the fix has been released in v2.4.1.