Skip to Content
Azure Serverless Computing Cookbook - Second Edition
book

Azure Serverless Computing Cookbook - Second Edition

by Praveen Kumar Sreeram, Jason Marston
November 2018
Intermediate to advanced
424 pages
10h 55m
English
Packt Publishing
Content preview from Azure Serverless Computing Cookbook - Second Edition

Developing the Azure Function – queue trigger

Perform the following steps:

  1. Create a new Azure Function named ProcessData using the queue trigger and configure the myqueuemessages queue. This is what the Integrate tab should look like after you create the function:
  1. Replace the default code with the following code:
        using System;        public static void Run(string myQueueItem,          ILogger log)        {           if(Convert.ToInt32(myQueueItem)>50)           {              throw new Exception(myQueueItem);           }           else           {              log.LogInformation($"C# Queue trigger function                processed: {myQueueItem}");           }        }

The preceding queue trigger logs a message with the content of the queue (it's just a numerical ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Azure Serverless Computing Cookbook

Azure Serverless Computing Cookbook

Praveen Kumar Sreeram
Azure Serverless Computing Cookbook - Third Edition

Azure Serverless Computing Cookbook - Third Edition

Praveen Kumar Sreeram, Kasam Shaikh, Greg Leonardo
Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni

Publisher Resources

ISBN: 9781789615265Supplemental Content