In general, the easiest way to integrate Azure Functions with Azure Event Grid is to use HttpTrigger:
[FunctionName("HttpTriggerCSharp")]public static async Task<HttpResponseMessage> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log){ (...)}
This is the most generic setup. It provides direct access to a request message and enables you to control its specific parts. There is, however, an alternative to the preceding setup—we can instead use EventGridTrigger:
[FunctionName("EventGridTriggerCSharp")]public static void Run([EventGridTrigger]JObject eventGridEvent, TraceWriter log){ log.Info(eventGridEvent.ToString(Formatting.Indented)); ...