c# - Azure函数: Unable to convert trigger to CosmosDBTrigger

标签 c# azure azure-cosmosdb azure-functions

我只是在 Azure 门户中创建一个新的 CosmosDBTrigger 并将其连接到我的 Cosmos DB。没有改变任何东西。只需遵循默认的 example .

当我运行它时,我收到此问题标题中的文本异常。这是完整的日志:

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

这很奇怪。我记得一个月前也做过同样的事。好像最近有什么东西坏了。谷歌搜索特定消息会给出上个月的三个无用结果。

我能做什么?当一切正常时,我可以切换到某个以前的版本吗?

最佳答案

@psfi​​naki 你 cannot RUN the cosmos triggerAzure 门户,您必须创建更新受监视集合中的文档才能运行触发器。

在 Cosmos DB 触发器的 Azure 门户中不应存在或应禁用 RUN 选项,因为它与直接支持“RUN”选项的其他类型的触发器选项不同。

关于c# - Azure函数: Unable to convert trigger to CosmosDBTrigger,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48862833/

相关文章:

c# - 将 Caliburn.Metro.Demo 从 C# 转换为 VB

SQL Azure : Executing SQL directly; no cursor

azure - 在 Azure 应用服务上启用 gzip 压缩

c# - 如何在 cosmos db C# 中插入一个文档的项目列表?

performance - 将 Azure 搜索与 DocumentDB 结合使用

c# - 找到最低的子文件夹并压缩它们

c# - 将依赖注入(inject)到 DTO 中

c# - 以下静态方法线程安全吗?

azure - 在 ADX Cluster 中执行 create-materialized-view 查询时,出现与缓存策略相关的错误

azure-cosmosdb - 连接到多个 CosmosDB 文档