I am trying to trigger an Azure function when a new queue message is added. Both the storage account and the azure function are in the same region.
For my Azure Function, I clicked on Add, Azure Queue Storage Trigger, I gave my function a name, and the Queue name is the same name as my queue. I tried adding a new queue message, nothing is triggered.
I then tried modifying the code as the following:
using System;
[FunctionName("QueueTrigger")]
[StorageAccount("storagetestaccount1")]
public static void Run(
[QueueTrigger("queue1")] string myQueueItem,
ILogger log)
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
}
But still no success. Any idea what might be causing this?
This is my first azure function so not sure what's correct and what's not.
[QueueTrigger("myqueue-items", Connection = "StorageConnectionAppSetting")]
then everything should be ok. And are you developing locally or on azure? – Cindy Pau