I am trying to implement a simple custom handler in Golang with and HTTP trigger and a Cosmos DB input binding. However I keep getting this error:
When I run the function without the Cosmos DB input binding, everything works as expected. Here is my functions.json configuration:
{
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "res"
},
{
"type":"cosmosDB",
"name": "docs",
"direction": "in",
"connectionStringSetting": "CosmosDB",
"collectionName": "Items",
"databaseName": "devdb",
"createIfNotExist": "true"
}
]
}
enableForwardingHttpRequest
set in yourhost.json
file, then requests are sent to your custom handler at/api/FunctionName
. However, when you use other bindings, requests are sent to/FunctionName
.