无法解析属性“CosmosDBAttribute.ConnectionStringSetting”的值

2024-02-10

我使用 Visual Studio 和 CosmosDB 输出开发了简单的服务总线触发器。 Service Bus 和 CosmosDB 的连接字符串在 local.settings.json 中定义。 代码在本地功能齐全。现在我已经将 Zip Published Function(C#) 发布到 Azure。

我收到错误:

Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1'. 
Microsoft.Azure.WebJobs.Host: Unable to resolve the value for property 
'CosmosDBAttribute.ConnectionStringSetting'. 

我应该怎么办?


该错误表明您需要在 Azure 上添加设置。

azure 上的 azure 函数与本地上的 azure 函数不同。在本地,设置位于 local.settings.json 中。但在 azure 上,它位于配置中。(即使您部署了 local.settings.json,该函数也会从配置中读取环境设置)

并且不要忘记保存您的编辑。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法解析属性“CosmosDBAttribute.ConnectionStringSetting”的值 的相关文章

随机推荐