Open konrad11901 opened 1 week ago
Hi @konrad11901 Thanks for reporting I have checked and created same for run every min same funct it working fine. locally.can you check it again.
@bhagyshricompany I checked that and locally it seems to be working fine. So it looks like the issue occurs only after deployment to Azure.
Investigative information
Please provide the following:
Repro steps
Function source code
Program.cs
```csharp using Microsoft.Azure.Functions.Worker; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = new HostBuilder() .ConfigureFunctionsWebApplication() .ConfigureServices(services => { services.AddApplicationInsightsTelemetryWorkerService(); services.ConfigureFunctionsApplicationInsights(); }) .Build(); host.Run(); ```Package references
```xmlCreate a new Azure Functions instance and necessary dependencies:
Deploy the previously created function:
Expected behavior
Function execution finishes successfully.
Actual behavior
Function execution is being killed by the host within a minute of starting the function.
It looks like there is some scaling down involved (that's my guess based on DrainMode mention in logs), which kills the ongoing execution of the function?
Known workarounds
Manual rerun of the function seems to work.
Related information
We had this issue earlier too (back in August) - then a simple package update seemed to help as the functions were working fine till the beginning of October.
This issue is not occurring on the Consumption plan.
Programming language used: C# Bindings used: Timer
Logs
``` 10/16/2024, 10:00:00.002 AM Executing 'Functions.TimerFunction' (Reason='Timer fired at 2024-10-16T09:59:59.9998519+00:00', Id=c2c3130e-7709-4710-af5c-ee2b4c024f95) 10/16/2024, 10:00:25.346 AM DrainMode mode enabled 10/16/2024, 10:00:25.346 AM Calling StopAsync on the registered listeners 10/16/2024, 10:00:25.347 AM Stopping the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'TimerFunction' 10/16/2024, 10:00:25.356 AM Someone (user or Azure Functions host) requested to cancel the job! Trace: at System.Environment.get_StackTrace() at FlexConsumptionTimer.TimerFunction.