azure-storageazure-functionsazure-queuesqueuetrigger

Reading a message in Azure storage queue multiple times


Context: I have an Azure storage queue that is used as the input queue for a Queue Trigger Function. So, whenever a message gets added to the queue, some function X is triggered and starts running. I want to test that the message was successfully put in the queue and consumed. How can I do that from the queue only (assuming I do not have visibility into my function X, and I can not change the settings for the Queue Trigger Function)? To further break down this question:

Thanks!


Solution

  • I don't think the way you're trying to do this will work. You can get part of the way by using Peek Messages to read queue messages without dequeuing them, but if the Function gets to a message before you then you'll never see it in the first place.

    However, you might might be able to get the information you need by using Storage Analytics Logging to track queue activity, or by using Service Bus topics instead of a queue so your messages can have multiple subscribers.