Skip to content
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

Unable to convert trigger to CosmosDBTrigger. #2435

Closed
alohaninja opened this issue Feb 19, 2018 · 3 comments
Closed

Unable to convert trigger to CosmosDBTrigger. #2435

alohaninja opened this issue Feb 19, 2018 · 3 comments

Comments

@alohaninja
Copy link

alohaninja commented Feb 19, 2018

Investigative information

Unable to use .NET for new cosmos triggers (Exception binding parameter 'documents'). Modifying existing ones is also breaking with this same error when updating assemblies. Javscript cosmos triggers are working just fine.

First reported on SO about 9 hours ago...

Repro steps

Create new cosmos db c# trigger from the portal.

Expected behavior

Cosmos trigger fires as expected and bindings work without issue

Actual behavior

Exception while executing function: Functions.onCollectionChanged 
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.onCollectionChanged ---> System.InvalidOperationException : Exception binding parameter 'documents' ---> System.InvalidOperationException : Unable to convert trigger to CosmosDBTrigger.
   at Microsoft.Azure.WebJobs.Extensions.DocumentDB.CosmosDBTriggerBinding.BindAsync(Object value,ValueBindingContext context)
   at async Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding`1.BindCoreAsync[TTriggerValue](ValueBindingContext context,Object value,IDictionary`2 parameters) 
   End of inner exception
   at Microsoft.Azure.WebJobs.Host.Executors.DelayedException.Throw()
   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstance instance,ParameterHelper parameterHelper,TraceWriter traceWriter,CancellationTokenSource functionCancellationTokenSource)
   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)
   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) 
   End of inner exception
@alohaninja
Copy link
Author

alohaninja commented Feb 19, 2018

You cannot trigger (aka RUN) a new cosmos trigger from the portal directly or you receive this error. You just need to create OR update a document in the monitored collection and the trigger will fire as expected.

@psfinaki
Copy link

@alohaninja Confirmed, works. Thank you! (just wanted to say thanks somewhere, I am the guy who asked the SO question)

@jimwilliam
Copy link

i'm not running a trigger function from the portal but getting it when items arrive and the trigger reading off of the change feed fires. I've not seen that before.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants