I'm trying to write a system in Azure, and for one part of it I want to be able to have a number of bits of code writing to a queue, and have a single bit of processing code deal with each item in the queue.
Items are being added to the queue correctly. I've checked this; I have Visual Studio with the Azure plugins. I can then use Cloud Explorer to pull up the storage account and view the queue. In here, the queue content seems correct, in that the Message Text Preview looks as I would expect.
However, when I add an Azure Functions with a Queue Trigger to process this, while the trigger fires, the queue item comes out empty. I've tried the tutorial code, cut down a little. When I set the run function to be:
public static void Run(string myQueueItem,
DateTimeOffset expirationTime,
DateTimeOffset insertionTime,
DateTimeOffset nextVisibleTime,
string queueTrigger,
TraceWriter log)
{
log.Info($"C# Queue trigger function processed: '{myQueueItem.GetType()}'\n" +
$"queueTrigger={queueTrigger}\n" +
$"expirationTime={expirationTime}\n" +
$"insertionTime={insertionTime}\n" +
$"nextVisibleTime={nextVisibleTime}\n");
}
I then get output with the queue item is empty, when I know it isn't. The queue trigger element is also empty. Here is some sample output, when I run the function directly in Azure Functions:
016-11-01T13:47:41.834 C# Queue trigger function processed:
queueTrigger=
expirationTime=12/31/9999 11:59:59 PM +00:00
insertionTime=11/1/2016 1:47:41 PM +00:00
The fact that this triggers at all, and has a sensible looking insertion time suggests that I'm connecting to the right queue.
Does anyone know why the string myQueueItem coming out empty, when the queue peeking tool can see the full preview string?