How to do it...

  1. Create a new function by choosing the GenericWebHook-C# trigger and name it ValidateTwitterFollowerCount.
  2. Replace the default code with the following:
        #r "Newtonsoft.Json"        #r "SendGrid"        using System;        using System.Net;        using Newtonsoft.Json;        using SendGrid.Helpers.Mail;        public static void Run(HttpRequestMessage req,                                TraceWriter log,                               out Mail message                              )        {           log.Info($"Webhook was triggered!");           string jsonContent = req.Content.ReadAsStringAsync().Result;           dynamic data = JsonConvert.DeserializeObject<dynamic>            (jsonContent);           string strTweet = "";           if(data.followersCount >= 200)           {              strTweet = "Tweet Content" +  data.tweettext;              message = new Mail();              message.Subject = $"{data.Name} with  {data.followersCount} followers has posted a tweet"; ...

Get Azure Serverless Computing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.