0
votes

Can we use Azure Queue message as an event source to an event grid triggered Azure function? If so, how we can configure it. currently only blob storage is showing as event sources in storage account.

enter image description here

Note: My requirement is to Run azure function, whenever new message is entered into the storage queue. The message parameter info also to be passed to Azure function.

2
Why not use queue trigger?Frank Gong
The answer is no.Cindy Pau
Use queue trigger or logic app without any code. It will workRahul Shukla
Hi, any update of this question? Have you check my answer?Cindy Pau

2 Answers

-1
votes

Currently, Storage Queues being an event source is unavailable. There is something that exactly does what you are looking for => Azure Storage Queue Trigger. Choose the mentioned template in Azure Functions, and provide your Storage Queue name and connection details. Your storage account's connection string will be used by the function automatically, and start monitoring the queue. Whenever a new message arrives, your function gets triggered.

Here's a C# example of handling the message that is passed to the triggered function:

public static class QueueTrigger
{
    [FunctionName("QueueTrigger")]
    public static void Run(
        [QueueTrigger("myqueue-items")] string message, ILogger log)
    {
        log.LogInformation($"Here's the item: {message}");
    }
}

Note: Functions expect a base64 encoded string. Any adjustments to the encoding type (in order to prepare data as a base64 encoded string) need to be implemented in the calling service. Reference.

-1
votes

Check this doc:

https://docs.microsoft.com/en-us/azure/event-grid/overview

enter image description here

Queue Storage can't be the source of the event grid, so the answer is no.

And as Frank says, your can use queue trigger other than use queue storage as event source.