Created
January 8, 2020 09:44
-
-
Save pmatthews05/b4bb42d881f674358e52790bb9704736 to your computer and use it in GitHub Desktop.
Audit O365 Webhook Trigger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string stringvalue = await req.Content.ReadAsStringAsync(); | |
log.LogInformation($"Req.Content {stringvalue}"); | |
try | |
{ | |
log.LogInformation("Getting validation code"); | |
dynamic data = await req.Content.ReadAsAsync<object>(); | |
string validationToken = data.validationCode.ToString(); | |
log.LogInformation($"Validation Token: {validationToken} received"); | |
HttpResponseMessage response = req.CreateResponse(HttpStatusCode.OK); | |
response.Content = new StringContent(validationToken); | |
return response; | |
} | |
catch (Exception) | |
{ | |
log.LogInformation("No ValidationCode, therefore process WebHook as content"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment