gpt4 book ai didi

c# - 无法解析属性 'CosmosDBAttribute.ConnectionStringSetting' 的值

转载 作者:行者123 更新时间:2023-12-04 00:58:10 26 4
gpt4 key购买 nike

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

我收到错误:

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

我应该做什么?

enter image description here

最佳答案

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

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

enter image description here

enter image description here

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

关于c# - 无法解析属性 'CosmosDBAttribute.ConnectionStringSetting' 的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60676398/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com