From the course: Azure Functions for Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Implementing the CosmosDB input binding in the Search function

Implementing the CosmosDB input binding in the Search function - Azure Tutorial

From the course: Azure Functions for Developers

Start my 1-month free trial

Implementing the CosmosDB input binding in the Search function

- [Instructor] In the previous video, we used a Cosmos DB output binding to write a photo meditator in the local Azure Cosmos DB emulator. Now we're going to see how to read that same meditator by using a Cosmos DB input binding. So let's create a new Azure function here. I'm going to use this option and let's name it photos search because that's exactly what we're going to do now. And let's select the HTTP trigger and let's select anonymous as the authorization level. Here I'm going to get rid of everything because I want to start with a clean slate and I also want to delete this post method because I want it to be related with the get method only and let's rename the logger and we're good to go. The first thing that I want to do is to add below the HTTP trigger line a Cosmos DB attribute and let's decorate the following object of type document client and let's name it client. As you can see, this is different than the…

Contents