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.
queue trigger
? – Frank Gong