-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration refresh does not work when ChainedConfigurationProvider is used #168
Comments
This is not a viable solution in .NET 6 as the user is not the one calling |
Please add App Configuration provider directly to your configuration builder instead of nested under the |
Is this a web app? If so, you should also add App Configuration middleware as instructed in the same document. It will take care of the configuration refresh. If it's a console app, you will need to call |
I'm so sorry, I seem to have just stopped reading after the step to add thank you very much for your help, it is working now. |
Now that the |
Yes, but that's only available in .NET 7. @avanigupta, we need to code this so it will "light up" when running in a .NET 7 app. |
Problem
A user added the App Configuration middleware to their application, but the configuration is not refreshed.
Cause
The
AzureAppConfigurationProvider
could be nested under aChainedConfigurationProvider
if the user callsIConfigurationBulder.AddConfiguration(...)
to add configuration built from the App Configuration provider.Unfortunately,
ChainedConfigurationProvider
does not provide a way for others to access its child providers. This caused the issue that the App Configuration middleware could not find the instance ofAzureAppConfigurationProvider
and thus cannot obtain the instance ofIConfigurationRefresher
.Proposal
There is no good solution to this. One idea from @drago-draganov is we provide an alternative API for users to call (the name is to be finalized)
Under the cover, this API will add a type derived from
ChainedConfigurationProvider
and this type we write exposes child providers.As part of fixing #166, we can provide additional information and suggest users to call this new API in the exception message.
Reference
The code of
ChainedConfigurationProvider
can be found athttps://github.com/dotnet/runtime/tree/master/src/libraries/Microsoft.Extensions.Configuration/src
cc: @drago-draganov @abhilasharora @jimmyca15
The text was updated successfully, but these errors were encountered: