Skip to content

Instantly share code, notes, and snippets.



Created May 8, 2016
What would you like to do?
#r "Newtonsoft.Json"
#r "D:\home\site\wwwroot\MyExtensions.dll"
using System;
using System.Net;
using Newtonsoft.Json;
using MyExtensions;
public static async Task<object> Run(HttpRequestMessage req, TraceWriter log)
log.Info($"Webhook was triggered!");
string jsonContent = await req.Content.ReadAsStringAsync();
dynamic data = JsonConvert.DeserializeObject(jsonContent);
if (data.first == null || data.last == null) {
return req.CreateResponse(HttpStatusCode.BadRequest, new {
error = "Please pass first/last properties in the input object"
var hoge = new [] {"hoge", "fuga"}.ToJoinedString(", ");
return req.CreateResponse(HttpStatusCode.OK, new {
greeting = $"Hello {data.first} {data.last}!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment