psfinaki
psfinaki

Reputation: 2142

Azure Functions: Unable to convert trigger to CosmosDBTrigger

I am just creating a new CosmosDBTrigger in the Azure Portal and connecting it to my Cosmos DB. Did not change anything. Just following the default example.

When I run it, I get the exception with the text from this question title. Here is the full log:

Exception while executing function: Functions.Test
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.Test ---> 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

This is very strange. I remember doing just the same a month ago. Seems like something has been recently broken. Googling the particular message gives three useless results from the last month.

What can I do? Can I switch to some former version of something when things worked?

Upvotes: 1

Views: 994

Answers (1)

SliverNinja - MSFT
SliverNinja - MSFT

Reputation: 31651

@psfinaki You cannot RUN the cosmos trigger from the Azure Portal, you must CREATE or UPDATE a document in the monitored collection for the trigger to RUN.

The RUN option should not be present or should be disabled in the Azure portal for Cosmos DB Triggers as it is not the same as other types of trigger options which do support "RUN" option directly.

Upvotes: 2

Related Questions