Retrieving Data from Cosmos DB

In this section, we'll retrieve documents from the Cosmos DB for display or manipulation. We have deployed Cosmos DB with transactions in the collection:

Let's begin by implementing the following steps:

  1. Create an Azure Function called GetTransactions and use the HttpTrigger template without parameters and Anonymous access rights.
  2. Add the line shown in the following screenshot to the method signature. You are adding a DocumentDB client as an input to the function, below the trigger. This allows you to execute more complex queries against DocumentDB:
  1. Next, you need to set some options for your query, setting ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.