2

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

smontoya
  • 91
  • 10

1 Answers1

5

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.

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
  • In my case, Javascript Azure function, in step 2 there is no "More templates" option... why? Cosmos DB trigger can't be used in a javascript Azure function? – smontoya Dec 09 '19 at 13:01
  • Hi @smontoya Could you please provide a screenshot of your page which missing "More templates" ? – Hury Shen Dec 09 '19 at 13:06
  • 1
    Hi @smontoya, I test it in my side. If we choose "linux" in the "Operating system" when we create the function app, it will not show "More templates". Could you please create another function app and choose "windows" ? – Hury Shen Dec 09 '19 at 13:19
  • You were right, with "windows" as "Operating system" all trigger options are available...This is a setback... anyway, question has been answered, so thanks. – smontoya Dec 09 '19 at 13:56
  • @smontoya, I'm happy that you have solved this problem. Could you please mark my answer as "accepted", thanks~ – Hury Shen Dec 09 '19 at 13:59
  • A useful reference documentation about [Azure Functions portal editing](https://learn.microsoft.com/es-es/azure/azure-functions/functions-deployment-technologies#portal-editing) related to this case. – smontoya Dec 09 '19 at 14:16