Skip to content

Instantly share code, notes, and snippets.

@thuru-zz
Created June 13, 2018 13:05
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 thuru-zz/7d564e3d80a2a24987dc72c17a7a00d0 to your computer and use it in GitHub Desktop.
Save thuru-zz/7d564e3d80a2a24987dc72c17a7a00d0 to your computer and use it in GitHub Desktop.
cosmos change feed azure function
using Microsoft.Azure.Documents;
using System.Collections.Generic;
using System;
public static async Task Run(IReadOnlyList<Document> input, TraceWriter log)
{
foreach(var changeInput in input)
{
if(changeInput.GetPropertyValue<string>("city") == "colombo")
{
log.Verbose("Something has happened in Colombo");
}
else
{
log.Verbose("Something has happened in somewhere else");
}
}
log.Verbose("Document count " + input.Count);
log.Verbose("First document Id " + input[0].Id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment