Skip to Content
Serverless computing in Azure with .NET
book

Serverless computing in Azure with .NET

by Sasha Rosenbaum
August 2017
Intermediate to advanced
468 pages
12h 5m
English
Packt Publishing
Content preview from Serverless computing in Azure with .NET

Creating a WebHook Trigger function

Let's create the Azure Function that will process the tweets by performing the following steps:

  1. In Visual Studio, right-click on the TextEvaluation project and navigate to Add -> New Item -> Azure Function.
  2. In Type, choose GenericWebHookCSharp, and in the name field, enter ScoreTweet.
  3. Once the template is generated, replace the function code in ScoreTweet.cs with the following code.

The function will be triggered by an HTTP WebHook from the Logic App and get the tweet body in JSON format. This code will leverage the Newtonsoft.Json library to deserialize the tweet from JSON:

        using System;        using System.Net;        using Newtonsoft.Json;        public static async Task Run(HttpRequestMessage req,          TraceWriter log)
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

Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni
Implementing Azure: Putting Modern DevOps to Use

Implementing Azure: Putting Modern DevOps to Use

Florian Klaffenbach, Oliver Michalski, Markus Klein, Mohamed Wali

Publisher Resources

ISBN: 9781787288393Supplemental Content