Created
May 2, 2020 16:59
-
-
Save xximjasonxx/999bbb981ef7e1ac130ba280084f01fb to your computer and use it in GitHub Desktop.
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
[FunctionName("CreateAggregateDocument")] | |
public static IActionResult Run( | |
[HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, | |
[CosmosDB(databaseName: "namesdata", collectionName: "firstletterstrend", | |
ConnectionStringSetting = "CosmosDbConnection")]out dynamic document, | |
ILogger log) | |
{ | |
var eventDataContents = req.ReadAsStringAsync().GetAwaiter().GetResult(); | |
// create the collated event data into our document db | |
document = new { | |
id = Guid.NewGuid(), | |
timestamp = DateTime.UtcNow, | |
eventData = JArray.Parse(eventDataContents) | |
}; | |
return new OkObjectResult("received"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment