我试图按照帮助链接中提供的方式创建 Azure Functions - https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/
我实际上正在创建一个 Evenhub 触发器来将消息写入 Blob 存储。
当我尝试运行该项目时,出现错误:
"Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.DashPOCEventHub'. Microsoft.WindowsAzure.Storage: Value cannot be null."
我已将正确的值放入 appsettings.json 中。
有人可以帮我解决这个错误吗?
此外,当我尝试将该函数发布到 Azure 时,appsettings.json 未正确设置。当我进入 Azure UI 应用程序设置页面时,我看不到值和键。
最佳答案
部署时,
appsettings.json
不会创建/覆盖您的网络应用 ApplicationSettings。您需要为 Web 应用程序指定 ApplicationSettings explicitly .
这样做的原因是,您可以在本地使用与您部署的内容(Web 应用程序 appsettings)不同的 secret (appsettings.json
)。
有关 appsettings.json
和 Web 应用程序应用程序设置 here 的更多信息.
关于Azure 函数 - Visual Studio 工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43051679/