Hello All,
I managed to set up CosmosDB and Azure Function HTTP Trigger in Javascript with Binding input/output. Azure Function is trigger by entering on my website but it is resulting with an error which I found in Application Insight.
Error:
Exception while executing function: Functions.HttpTrigger1 Cosmos DB connection configuration 'CosmosDB' does not exist. Make sure that it is a defined App Setting.
I created connection between Function and CosmosDB.
Below Function.json code
{
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "res"
},
{
"name": "inputDocument",
"databaseName": "ToDoList",
"collectionName": "Items",
"connectionStringSetting": "db-cosmos_DOCUMENTDB",
"direction": "in",
"type": "cosmosDB"
},
{
"name": "outputDocument",
"databaseName": "ToDoList",
"collectionName": "Items",
"connectionStringSetting": "db-cosmos_DOCUMENTDB",
"direction": "out",
"type": "cosmosDB"
}
]
}
I hoping for help or any advice. Thank you.