Azure App Configuration: Issues Overriding Non-Prefixed Keys with Prefixed Variants
Given an Azure App Configuration key with no prefix: Setting123
, I am not able to override this key with a prefixed version of it Environment:Setting123
.
This returns the key with the value from the non-prefixed key. If I don't execute TrimKeyPrefix
then I see both values in the built config:
config.AddAzureAppConfiguration(options =>{
options.Connect(new Uri(url), token)
.Select(KeyFilter.Any)
.Select($"{environment}:*").TrimKeyPrefix($"{environment}:");
});
If I add a prefix to the non-prefixed key, then the last one added takes precedence as expected:
config.AddAzureAppConfiguration(options =>{
options.Connect(new Uri(url), token)
.Select($"{commonPrefix}*").TrimKeyPrefix($"{commonPrefix}")
.Select($"{environment}:*").TrimKeyPrefix($"{environment}:");
});
I'm seeking clarification as to if this is intended. I wasn't able to find any documentation that stated explicitly either way, but would expect it to have been called out if you are unable to override a non-prefixed key with a prefixed one.
Perhaps there are best practices that I am unaware of, would appreciate any guidance or input.