Inserting Documents into Cosmos DB

This section will discuss inserting documents into a Cosmos DB. It will leverage the near-infinite scale of Cosmos DB to deliver a planet-scale serverless application. And to ensure that it happens correctly, you will need a function in the state from the previous chapter and an Azure subscription with the ability to set up a Cosmos DB. Let's begin by implementing the following steps:

  1. Right-click on your project and select Manage NuGet Packages.... Install version 1.0.0 of MicrosoftAzure.WebJobs.Extensions.DocumentDB.
DocumentDB is the old name for Cosmos DB; Microsoft haven't updated all of the SDKs yet. There's an SDK with the new name, but it's still in beta. Refer to the complete code at: Code/ServerlessArchitectures-with-Azure/Lesson ...

Get Beginning Serverless Architectures with Microsoft Azure now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.