technonaut
technonaut

Reputation: 514

Azure Functions QueueTrigger never fires

My queuetrigger isn't being activated when data is added to the queue that I have specified a binding to. I have another durable function that receives some JSON data and puts it into that queue; I know that works because I can see the data appear in the queue using storage explorer. But my queuetrigger function never fires after data arrives in the queue.

I know it isn't firing because the Total Execution Count shows 0 in the portal.

The complete function is quite long, so I'll share what I think are the most relevant bits of it:

namespace Company.MySpecial
{
    public static class MySpecialQueueProcessor
    {
        [FunctionName("MySpecialQueueProcessor")]
        public static async void Run([QueueTrigger("myspecialqueue")]String transdata, 
        // various table mappings edited out
        ILogger log)
        {
            MySpecialItem Item = JsonConvert.DeserializeObject<MySpecialItem>(transdata);
            log.LogInformation($"[GROOVE-QUEUE] {Item.email} Queue processor activated");
        return;
        }
    }
}

I have the async there because I need to call some tasks that require the await operator, and it won't let me use await without the async. Example:

await MyData.AddAsync (Item);

And retrieving data from a table:

                do
                {
                var page = await GrooveProductMappings.ExecuteQuerySegmentedAsync(productQuery, ct);
                ct = page.ContinuationToken;
                Matches.AddRange(page.Results);
                }
                while (ct != null); 

I don't know if this could be part of my issue or not.

Is there something wrong with my code, or is there something else that I've not done in Azure that's needed for it to work?

Upvotes: 1

Views: 211

Answers (1)

dedreira
dedreira

Reputation: 63

I have three questions:

  1. Is the Queue Storage Account ConnectionString properly set in the Function App Settings?
  2. Are you referencing that setting properly in your function.json "connection" property?
  3. Are you pointing to the right queue in your function.json "queueName" property?

https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=csharp#configuration

You can also check for errors in Application Insights "Live Metrics" (if you have it configured for your Function)

Upvotes: 1

Related Questions