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?