-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Can't figure out which ctor to call." error with CosmosDB trigger #2447
Comments
thanks for reporting please share the repro steps. |
have you properly used local setting.json file like azurewebjob storage etc. |
Yep, local.settings.json is properly configured. I used the wizard to walk through the process. Reproduction steps (in VS Code):
The Azure Functions extension does the rest. I did check both my local.settings.json file and my configuration params, and it all seems correct. |
@bhagyshricompany See comment above. |
I'm facing the same issue. Creating a brand new Azure Function CosmosDB trigger via the VS Code extension generates this error on function start. |
Same issue, via VS Code |
it seems that you need to add 'connection' and 'containerName' instead of connectionStringSetting and collectionName, if you dont the Options probably get recognized as v3Options instead of v4options. |
@mattonecz is right, VSCode template is just using the wrong key names. For working V4 names, check Configuration |
Nice. This got me past my error. I guess the request here then is to update the VS Code template. It would also be nice if the Model version was more obvious somehow. Just looking through my config, I'm not sure how I'd know that I should be using Model v4 over v3. |
This issue still persists with the latest Azure Functions Core Tools updated in VisualStudio Code Insiders, and following all the default prompts to create an Azure Cosmos DB Trigger function. using JavaScript, Model V4. This has fortunately been pointed out above, and saved me lots of time. |
I'm trying to run a new Function locally. It uses the CosmosDB trigger. Building works fine, but when trying to run with
func host start
, I get this error: The 'companiesWrite' function is in error: Unable to configure binding 'cosmosDBTrigger1' of type 'cosmosDBTrigger'. This may indicate invalid function.json properties. Can't figure out which ctor to call.I see a similar issue here: #277. The problem was a misnamed configuration property. But I checked all of mine against both the TypeScript def and the online documentation.
My code:
My host.json:
I tried adding an HttpTrigger Function, and this worked fine. So it appears to be something specific to my CosmosDB trigger.
Thanks!
The text was updated successfully, but these errors were encountered: