Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created May 2, 2020 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/999bbb981ef7e1ac130ba280084f01fb to your computer and use it in GitHub Desktop.
Save xximjasonxx/999bbb981ef7e1ac130ba280084f01fb to your computer and use it in GitHub Desktop.
[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