Krushna Kumar
Krushna Kumar

Reputation: 71

Azure poison queue not being created for azure queue trigger functions failure

I'm working on some automation work for azure activities with powershell, as a part of it we are using queuetrigger functions. But whenever an error occurs the poison queue for those messages is not creating. We are able to log the errors in app-insights using try catch block but we are not able see the poison queue creation for those messages

Upvotes: 2

Views: 1268

Answers (1)

Harshita Singh
Harshita Singh

Reputation: 4870

Follow below steps and see if you missed out on anything.

  • Create a queue message handler:

    enter image description here

    If you fail for some reason to handle message properly (read - you throw exceptions during the handling), runtime will decide at some point to move your message to poison queue. You can read more about this mechanism here. You can of course do try\catch option here as well, but then question is what exactly are you going to do inside catch to make a retry later? Best option is to just let an exception fly up to the runtime and delegate dequeue on next round.

  • When you fail to handle message properly (there is even a threshold how many times runtime will retry to give you your message for processing before moving to the poison queue):

    enter image description here

Please note: The poison queue will be {your-queue-name}-poison. There should not be any permissions (RBAC) restrictions on your blob storage. If there is, please give your function app appropriate permissions.

Additional information: If you want to handle poison messages, you can go through this step by step guide: Capture Exception in Azure Functions Poison Queue Trigger

Upvotes: 1

Related Questions