Share via

Azure function stopped working after deployment due to another azure function

Amer ELMughrabi 0 Reputation points
2025-10-08T18:15:14.4733333+00:00

I have a project with a mix of azure functions, this week I deployed a new one (timer trigger) that monitors all queues to alert me when there is a message older than 24hrs in any queue including poison queues. For whatever reason, this function only starts then exits, and does not work in production (sandbox subscription works fine).

What I'm seeing, after I deployed this function (lets call it B), I have another function A that also started doing the same, but since this one is triggered from a queue, it keeps re-queuing messages. So, within less than 24hrs I have 18.5 million messages in the queue when its usually should be about 1-2k per day.

Last week, I had the same issue when I deployed the original function which only monitors poison queues, but retrieve these queues programmatically. After deployment, I found 4 days later that this queue has 34 million message (same queue) and function A is behaving the same.

After I analyzed around 3 million of these messages, I found out that its only 133 unique message, but somehow FunctionA requeues these messages again and again

Help me understand whats going on and how I can fix it.

Thanks

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. Luis Arias 9,536 Reputation points Volunteer Moderator
    2025-10-14T19:42:53.1+00:00

    Hello Amer, Welcome to Microsoft Q&A, Sounds like Function B (your timer-triggered queue monitor) is unintentionally interfering with Function A’s queue processing. Based on Microsoft docs, this usually happens when multiple functions share the same queue and one of them exits without completing or explicitly abandoning the message. Azure Functions uses the Poison Message Handling model , if a message isn't completed or deleted, it gets re-queued. Since Function B scans queues but doesn’t process or delete messages, it might be triggering the dequeue count increment without handling the message, causing Function A to reprocess the same ones repeatedly.

    To fix this:

    • Make sure Function B uses PeekMessagesAsync() instead of ReceiveMessagesAsync() or any method that locks/dequeues messages.
    • If using SDKs, avoid triggering the queue’s dequeue logic unless you're explicitly processing messages.
    • Monitor DequeueCount in queue metrics to confirm the behavior.

    Also, double-check that both functions aren’t bound to the same queue trigger unintentionally.

    References:

    If the information helped address your question, please Accept the answer. Luis

    Was this answer helpful?

    0 comments No comments

Your answer

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