0

I’m working on an Azure Functions project using the new Flex Consumption model with @azure/functions in TypeScript.

I have two functions:

Producer – sends a message to a storage queue:

export async function sendToProcessingQueue(payload: any) {
    const connectionString = process.env.AzureWebJobsStorage;
    const queueName = "question-paper-processing-queue";

    const queueClient = new QueueClient(connectionString!, queueName);
    await queueClient.createIfNotExists();

    const message = JSON.stringify(payload);
    await queueClient.sendMessage(Buffer.from(message).toString("base64"));
}

Consumer – supposed to be triggered by new queue messages:

app.storageQueue("storageQueueTrigger", {
  queueName: "question-paper-processing-queue",
  connection: "AzureWebJobsStorage",
  handler: storageQueueTrigger,
});

export async function storageQueueTrigger(
  queueEntry: any,
  context: InvocationContext
): Promise<void> {
  context.log("Raw queue entry:", queueEntry);
  // process the message...
}

When I run the app, I only see connected!. The message gets added to the queue (I checked in Azure Storage Explorer), but the function never fires.

Things I’ve verified:

  • The queue exists (question-paper-processing-queue).
  • Both producer and consumer use the same connection string (AzureWebJobsStorage).
  • Message is visible in the queue.
  • Function app starts with no errors.

Why isn’t my storage queue trigger firing in Azure Functions?

1
  • The Flex Consumption model is still evolving, queue triggers may not be reliably wired in configurations. function.json file must define queue trigger. If it's misconfigured, the runtime won’t register trigger. Ensure your consumer function has function.json file with correct trigger configuration. Check that AzureWebJobsStorage is correctly set in app settings and matches connection string used by producer and consumer. Add more verbose logging in consumer function and enable Application Insights to trace execution. Ensure your project is using a supported runtime version for queue triggers Commented Sep 1 at 22:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.