Reputation: 4216
If I have another Azure Function creating documents, based on some other event (e.g. API call).
Is there support (or will there be) to have an Azure Function run based on a new document being created?
using System;
public static void Run(object doc, TraceWriter log)
{
log.Info($"doc based trigger? ... {doc}");
}
Binding I tried to use, i tried it with and wihout the "id" property, and type documentDB
and documentDBTrigger
:
"bindings": [
{
"type": "documentDB",
"name": "doc",
"databaseName": "MyDb",
"collectionName": "MyCollection",
"connection": "mydb_DOCUMENTDB",
"direction": "in"
}
Upvotes: 2
Views: 599
Reputation: 13558
No, we don't currently have a DocumentDB trigger binding. Only input and output bindings.
The underlying DocumentDB support for Azure Functions lives in the azure-webjobs-sdk-extensions repo. Feel free to leave an issue in that repo for this feature request :)
Upvotes: 3
Reputation: 18387
I think you're searching for this: https://azure.microsoft.com/en-us/documentation/articles/functions-bindings-documentdb/
Another option: you can create a DocumentDB trigger that will put a message into a service bus Queue, and then, use a Service Bus binding for your Azure Function:
https://azure.microsoft.com/en-us/documentation/articles/functions-bindings-service-bus/
Upvotes: 0