The following project contains samples using Azure Function's Cosmos DB Output Binding.
It contains 2 different samples:
- HttpTriggerToAsyncCollector: Use an HTTP POST to send a batch of documents to be saved to a container in a single operation.
- HttpTriggerWithSingleDocument: Use an HTTP POST to send a single document to be saved to a container.
- HttpTriggerToAsyncCollectorMultiMaster: Use an HTTP POST to send a batch of documents to be saved to a container in a single operation, with Multi Master support and defining a preferred write region.
You can use Visual Studio Code, Visual Studio or even the Azure Functions' CLI. You only need to customize the local.settings.json file to match the Cosmos DB Connection String, Database name, and Collection/Container name on which you want the documents to be saved to.