I wrote a short azure function to simply take data in from CosmosDB change feed Trigger.
However, looks like it returns some form of encoded data.
For example
{
"_id" : ObjectId("5ad8db107dfa95101430ab94"),
"id" : "task123",
"type" : "genera123l",
"information" : "some task"
}
If above document is created in my cosmos db,
public static void Run(IReadOnlyList<Document> documents, TraceWriter log)
{
if (documents != null && documents.Count > 0)
{
log.Info("Documents modified " + documents.Count);
log.Info("First document Id " + documents[0].Id);
}
}
above code will print
2018-04-19T19:28:23.899 [Info] Documents modified 1
2018-04-19T19:28:23.899 [Info] First document Id NWFkOGRiMTA3ZGZhOTUxMDE0MzBhYjk0
instead of
2018-04-19T19:28:23.899 [Info] Documents modified 1
2018-04-19T19:28:23.899 [Info] First document Id task123
which is the expected output. Is there some sort of configuration that I'm missing here?
Looks like none of the documentations for CosmosDB or Azure Function App addresses this issuse :(
Thanks