smontoya
smontoya

Reputation: 91

How to build an Azure Function with Cosmos DB Trigger?

I am trying to develop in Azure portal an Azure Function (Node.js) that is triggered by Cosmos DB when create a doc. Azure documentation says that to do so, first i have to select "Cosmos db trigger" from templates, but no templates appear in my function... Only HTTP an Timer trigger options appears. I would like to work with CosmosDB and IoTHUB as triggers, input-output. Any requirement that have been overlooked? Why do not I have more triggers options? Need guidance.

HTTP and timer trigger as only options

option "More templates" do not appear on quick start

Upvotes: 2

Views: 595

Answers (1)

Hury Shen
Hury Shen

Reputation: 15724

It seems you create a "httptrigger" function, you need to create Cosmos DB trigger by the template. Please refer to the steps below: 1. Click "+" --> "In-portal" enter image description here

2.Click "More templates" --> "Finish and view templates" enter image description here

3.Choose "Azure Cosmos DB trigger" enter image description here

4.Click "Install" enter image description here

5.Fill in the input box with your cosmos db details. enter image description here

For further information, you can refer to this tutorial.

Upvotes: 5

Related Questions