Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.93k stars 441 forks source link

Queue Trigger - Consumption Plan - Goes to sleep and does not wake up #10508

Open MLRichmond opened 2 weeks ago

MLRichmond commented 2 weeks ago

Check for a solution in the Azure portal

We have a simple Azure Function that is running on a Consumption ASP. The function runs fine when initially deployed or when "poked" from the Azure Portal - but after a period of time, goes to sleep and does not wake up, even if new messages arrive in the corresponding queue.

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

1) QueueTrigger function using Managed Identity and App Settings Connection information. 2) Deploy function 3) Add msg to queue 4) Msg processes. 5) Wait 20-30 minutes (AppInsights log will show several "Disposing ScriptHost" messages) 6) Add msg to queue 7) Msg is never processed.

Expected behavior

Expected that QueueTrigger would eventually wake up and process the incoming message.

Actual behavior

QueueTrigger never wakes up.

Known workarounds

Go to Azure Portal and view Function. It will wake up and process.

Related information

bhagyshricompany commented 2 weeks ago

Hi @MLRichmond thanks for reporting can you try with same connection string ?

MLRichmond commented 2 weeks ago

@bhagyshricompany Sorry, what do you mean by same connection string? Re-testing this morning, it's still not waking up.

bhagyshricompany commented 2 weeks ago

you are using identity for connection option? please share log details.Thanks

MLRichmond commented 1 week ago

Basically after 20 minutes or so of not receiving a queue message, we see this: image Then after that, if send in a new message, it never wakes up.

Angelm116 commented 1 week ago

I am seeing a similar issue, but with a timer trigger function. The timer is set to trigger every 5 minutes. The function goes to sleep 20 minutes after deployment, and the timer trigger no longer fires. Similar to your case, the trigger starts firing again when I open the function in Azure Portal. When I go to Developer tools -> Kudu -> LogFiles, I see this:

Image