Azure function does not trigger

Anca Corbos 25 Reputation points
2025-03-17T14:49:53.48+00:00

Hello,

we have an Azure Function on plan EP2, which is triggered by a queue. Sometimes the function is not triggered until we visit the function in the Azure Portal.

The queue maxPollingInterval is set to 2 seconds. There should always be an instace ready in EP2.

Today, for example, we found 3 messages waiting in the queue. As soon as I went to see the last invocations of the function in the portal, they were picked up.

You see the delay in the screenshot: 41 minutes, 28 minutes, repectively 25 minutes (local time is UTC+1 hour)

User's image

Can someone please explain?

Here is an invocation ID for Microsoft to quickly find our data: 438942da-ce72-4ba4-9f36-77f1216ce8fe

Thank you,

Anca

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
{count} vote

Accepted answer
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2025-03-28T05:18:09.3266667+00:00

    @Anca Corbos Thanks for your patience on this. I am summarizing the offline investigations and posting the same answer for the benefit of other community members.

    Issue: Azure Function took around 40 minutes to consume the message from storage queue.

    Root Cause:

    • During the specified time frame, we observed high CPU usage, which affected the function host's ability to execute background tasks like queue polling. Queue polling relies on asynchronous I/O operations, and excessive CPU-bound tasks can exhaust the .NET thread pool, preventing new threads from being scheduled for polling.
    • To identify the cause of the 100% CPU usage and host thread starvation during the first message execution, review the Application Insights logs. Also, check the application code whether you are creating multiple new threads instead of completing the existing thread to complete the operation this might be one of the causes for high CPU.
    • Finally, it is recommended to disable Dynamic Concurrency to avoid the known issue of Azure functions getting stuck running at 100% CPU Azure function gets stuck running to 100% CPU.

    Hope this helps, let me know if you have any further questions on this.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.