My Azure Function in Python v2 doesn't show any signs of running, but it probably is

Rok Carl 20 Reputation points
2023-01-29T09:20:01.31+00:00

I have a simple function app in Python v2. The plan is to process millions of images, but right I just want to make the scaffolding right, i.e. no image processing, just dummy data. So I have two functions:

  • process with an HTTP trigger @app.route, this inserts 3 random image URLs to the Azure Queue Storage,
  • process_image with a Queue trigger @app.queue_trigger, that processes one image URL from above (currently only logs the event).

I trigger the first one with curl request and as expected, I can see the invocation in the Azure portal in the function's invocation section and I can see the items in the Storage Explorer's queue.

But unexpectedly, I do not see any invocations for the second function, even though after a few seconds the items disappear from the images queue and end up in the images-poison queue. So this means that something did run with the queue items 5 times. I see the following warning in the application insights checking traces and exceptions:

Message has reached MaxDequeueCount of 5. Moving message to queue 'case-images-deduplication-poison'.

Can anyone help with what's going on? Here's the gist of the code.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,116 questions
Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
95 questions
0 comments No comments
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,401 Reputation points
    2023-02-04T11:03:03.6+00:00

    @Rok Carl ,

    Please make sure that the message encoding is set to Base64
    https://stackoverflow.com/questions/71439701/error-message-has-reached-maxdequeuecount-of-5-moving-message-to-queue-webjo

    https://stackoverflow.com/questions/71305020/azure-queue-trigger-reaches-maxdequeuecount-immediately

    Also please make sure you have try catch block in the Queue trigger function to capture the exceptions which can be seen in the logs


0 additional answers

Sort by: Most helpful