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)

Get Serverless computing in Azure with .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.