I have an app where Azure functions are used for slow async tasks.
It is a c# app and the functions are declared similar to
[FunctionName(nameof(ConfirmationEmailFunction))]
public async Task Run([QueueTrigger(QueueNames.ConfirmationEmailQueue)] CloudQueueMessage queueMessage, ILogger log)
{
if (queueMessage.DequeueCount > 1)
log.LogWarning($"Message {queueMessage.Id} has been dequeued multiple times. Message: '{queueMessage}'");
var queueItem = JsonSerializer.Deserialize<ConfirmationEmailQueueItem>(queueMessage.AsString);
await SendConfirmationEmail(queueItem);
}
In the past when too many calls fail and the messages are moved to -poison queue, I used to go to "App service editor (Preview)" and go to function.json for the function I needed and added "-poison" to the binging queue name. This editor would auto-save the change and you would not need to restart the function app - it used to pick the change.
So, I didn't need to do it for a few years and now I tried it again - and the queue name changed ok, but the old non-poison queue was still used - and I could confirm it by manually adding a message to it and see it disappeared and processed.
I went to Advanced Tools -> Debug console and navifgated to the function.json and the queue is named with "-poison" in the end - which is as expected. I went to the function Integration and checked the trigger and it also has -poison in the end of the queue name.
I restarted the function app and it did not help - the old non-poison queue was still used.
So, do you know why it might stop working? Another question would be why the Azure portal shows the "...-poison" queue to be used as a trigger if the original non-poison queue is used instead?
Now, I am aware of other ways of processing the queue, but this one was super-convenient to use, you didn't need much to do and it just worked.