Azure / Azure/azure-functions-host
Azure functions with CosmosDB trigger do not recognize bindings of v4.x extension
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
Dependencies defined in my project (out-of process):
"Microsoft.Azure.Functions.Worker.Sdk" Version="1.9.0"
"Microsoft.Azure.Functions.Worker" Version="1.5.2"
"Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.0.1"
At the extensions.json I have:
"name": "CosmosDB",
"typeName": "Microsoft.Azure.WebJobs.Extensions.CosmosDB.CosmosDBWebJobsStartup, Microsoft.Azure.WebJobs.Extensions.CosmosDB, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"hintPath": "./.azurefunctions/Microsoft.Azure.WebJobs.Extensions.CosmosDB.dll"
So I'm using these bindings (as explained [here](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-trigger?tabs=python-v2%2Cisolated-process%2Cextensionv4&pivots=programming-language-csharp#attributes))
Connection
LeaseConnection,
LeaseContainerName
LeaseContainerPrefix
LeaseDatabaseName
The function app defined at the cloud has the following settings:
NET 6 LTS - isolated
FUNCTIONS_EXTENSION_VERSION ~4
FUNCTIONS_WORKER_RUNTIME dotnet-isolated
However, the expected bindings at the Azure function are the old style (< NET v3 SDK):
connectionStringSetting, leaseCollectionName, etc
I have a functions.medata file with the bindings defined (I do not use annotations at the code), and I noticed that only changing to the old-style names the Azure function did correctly match the bindings.
Why is this happening?
Locally, using the following version of
Azure Functions Core Tools, everything works OK with the correct bindings.
Core Tools Version: 4.0.4653 Commit hash: N/A (64-bit)
Function Runtime Version: 4.6.1.18388
I also noticed, that as it was reported [here](https://github.com/Azure/Azure-Functions/issues/2334), the function is not being triggered all the times it should.
Contributor guide
Assessment
This issue has not been assessed yet.