Open alexweininger opened 1 month ago
This is happening because the properties in the template are for extension bundle v3, but I'm using extension bundle v4. This documentation sort of explains this: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-trigger?tabs=python-v2%2Cisolated-process%2Cextensionv4%2Cnodejs-v4&pivots=programming-language-javascript
Code for CosmosDB trigger doesn't work with extension bundle version 4
To reproduce: Create a new TypeScript functions project (I haven't checked if this repros for JS, but I assume yes) that uses the v4 model. Add a CosmosDB trigger. Once added, the code will contain:
My extension bundle in the host.json is:
When run, the project will give this error: "The 'cosmosDBTrigger1' function is in error: Unable to configure binding 'cosmosDBTrigger0fe012de42' of type 'cosmosDBTrigger'. This may indicate invalid function.json properties. Can't figure out which ctor to call."
If you change the properties inside the function trigger code to the following, it works.