-
Notifications
You must be signed in to change notification settings - Fork 73
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
UseAzureAppConfiguration and AzureAppConfigurationRefreshMiddleware break context execution #915
Comments
Hi @fjbelizon, we got a similar issue about durable functions being broken a while back, but One helpful test would be to see if version 6.0.1 of the provider also causes this issue for you, since that was before we added the call to |
Hi @amerjusupovic. Ok, I'm going to do the test |
@amerjusupovic yes, same problem. Version 6.0.1 also breaks the execution of Eternal Functions. I attach the code sample for you to test: bug-azure-app-configuration-refresh-middleware.zip. I've put two ‘TODO’ tags for you to comment/uncomment the lines that make the execution work/fail. I look forward to your review. Thanks in advance. |
Any news about this issue? Thanks in advance |
Given there was a repro with 6.0.1 do you believe it would be the same issue as here? |
This comment was marked as outdated.
This comment was marked as outdated.
Ok, thanks @amerjusupovic 👌 |
This looks like a dupe of this issue. I don't think |
@amerjusupovic if you can confirm this is a dupe of the aforementioned issue we should merge this issue into the existing one which the Functions team mentioned they need to solve on their end. |
Sorry for the confusion in my previous response, yes the repro in 6.0.1 suggests it's the same issue, and that was before the call to |
is there any news about this issue? or any alternative, thanks in advance!! |
@BrunoCandia we're using the internal sealed class AzureAppConfigRefreshService : BackgroundService
{
private readonly IEnumerable<IConfigurationRefresher> _refreshers;
public AzureAppConfigRefreshService(IConfigurationRefresherProvider refresherProvider)
{
_refreshers = refresherProvider.Refreshers;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
try
{
foreach (var refresher in _refreshers)
{
await refresher.TryRefreshAsync(stoppingToken);
}
await Task.Delay(...);
}
catch (OperationCanceledException) when (stoppingToken.IsCancellationRequested)
{
_logger.LogInformation("AzureAppConfig has been stopped");
break;
}
}
}
}
// ...
// serviceCollection.AddHostedService<AzureAppConfigRefreshService>(); |
@amerjusupovic @jimmyca15 are there any news on this issue? We're still using our in-house kludge |
I have detected that if we make use of ‘UseAzureAppConfiguration’, which in turn internally injects the middleware ‘AzureAppConfigurationRefreshMiddleware’, it breaks the execution of the context of the Eternal Orchestration Functions.
I am using Azure Isolated Function in NET 8, using package ‘Microsoft.Azure.AppConfiguration.Functions.Worker’ in version 7.2.0.
The middleware internally performs an ‘ExecutionContext.SuppressFlow()’, which breaks the execution flow of the context: https://learn.microsoft.com/en-us/dotnet/api/system.threading.executioncontext.suppressflow?view=net-8.0
Right now the solution I am applying is to use ‘AddAzureAppConfiguration’ without ‘UseAzureAppConfiguration’. In my orchestrator constructor I inject ‘IConfigurationRefresherProvider’ to use the configuration refresher in the orchestrator activities.
The problem is not described anywhere and should be checked. Thanks in advance.
The text was updated successfully, but these errors were encountered: