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
IOptionsMonitor doesn't work dinamically with Azure AppConfiguration #52485
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
What's the lifetime of your service? It's resolving the current configuration value when it's constructed rather than when it's executed. If you move
|
Are you actually updating the watched configuration settings? Configuration won't update at the client unless you explicitly update any of the "watched" settings and even then it can take a minimum of the refresh interval. You also need to set the I use this mechanism and it works perfectly well so I can only imagine you are triggering the wrong settings or that labels are involved and you haven't set the LabelFilter in the refresher configuration. BTW since you are using a WebHost, there's an Aspnet sibling package for that library which adds a Middleware that automatically does the refreshing for you on each request (so you don't need to track the refresher object yourself) In any case I think this belongs in the Azure repos. |
Tagging subscribers to this area: @maryamariyan Issue DetailsI'm trying to use IOptionsMonitor for dinamic configuration with Azure AppConfiguration, the values are loaded correctly on starting the application. After started, when I update any settings on Azure App Configuration portal, the settings values keep the same. I've already used App Configuration in a function and it works properly, but nowadays I'm using WebHostedService DotNetCore. `public static void Main()
` ` private readonly RetryPolicyConfig retryPolicyConfig;
Any idea?
|
Wait.. seriously? This doesn't work? I was just wondering why it seemed like it wasn't and started googling. If this doesn't work, that's a major problem! Do we at least have a workaround for this? |
I was able to confirm the firing of The 'gotcha' is you have to call
|
@MRRQX if this is a web app, the Middleware provided by this Azure maintained package will do that for you automatically, assuming you're receiving traffic |
I'm trying to use IOptionsMonitor for dinamic configuration with Azure AppConfiguration, the values are loaded correctly on starting the application. After started, when I update any settings on Azure App Configuration portal, the settings values keep the same.
I've already used App Configuration in a function and it works properly, but nowadays I'm using WebHostedService DotNetCore.
the IOptionsMonitor is inject in service class
Any idea?
The text was updated successfully, but these errors were encountered: