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
It's useful for user code to obtain the instance of IConfigurationRefresher so they can refresh configuration synchronously or write their own middleware etc.
Proposal
Add extension method below that user can call in ConfigureServices(...)
User code can then get the instances of IConfigurationRefresher (via IConfigurationRefresherAccessor) from the DI.
Note: the implementation of IConfigurationRefresherAccessor will need to get IConfiguration from DI and cast it to IConfigurationRoot etc, just like what we do in the middleware today.
Other Considerations
We may need to consider exposing other properties in IConfigurationRefresher so users can differentiate instances from one to another.
We may consider changing our middleware to obtain instances of IConfigurationRefresher in the same way. This means users must call AddAzureAppConfiguration before they can call UseAzureAppConfiguration.
We need to run the code that we have in the middleware today to get IEnunmerable<IConfigurationRefresher>, which is the reason I think we need IConfigurationRefresherAccessor. I will be glad if we don't have to. I will leave this to @abhilasharora to find out.
It's useful for user code to obtain the instance of
IConfigurationRefresher
so they can refresh configuration synchronously or write their own middleware etc.Proposal
Add extension method below that user can call in
ConfigureServices(...)
Under the cover, this API will add
IConfigurationRefresherAccessor
to the DI.User code can then get the instances of
IConfigurationRefresher
(viaIConfigurationRefresherAccessor
) from the DI.Note: the implementation of
IConfigurationRefresherAccessor
will need to getIConfiguration
from DI and cast it toIConfigurationRoot
etc, just like what we do in the middleware today.Other Considerations
IConfigurationRefresher
so users can differentiate instances from one to another.IConfigurationRefresher
in the same way. This means users must callAddAzureAppConfiguration
before they can callUseAzureAppConfiguration
.cc: @abhilasharora @jimmyca15 @drago-draganov
The text was updated successfully, but these errors were encountered: