Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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
You can’t perform that action at this time.