【发布时间】:2017-12-15 17:36:57
【问题描述】:
似乎有很多类型,尽管某些项目只包括其中的一两个。
在 Visual Studio 预览中创建一个新函数,它会为您提供 host.json 和 local.settings.json。
I've also seen projects 与 function.json 和 project.json。
The Function docs 说明 function.json 的用途:
function.json 文件定义函数绑定和其他配置设置。运行时使用此文件来确定要监视的事件以及如何将数据传递到函数执行中并从函数执行中返回数据。
一个例子:
{
"disabled": false,
"bindings": [
// ... bindings here
{
"type": "bindingType",
"direction": "in",
"name": "myParamName",
// ... more depending on binding
}
]
}
host.json 还有一个目的,per the Azure webjobs SDK:
在根脚本目录中,应该有一个 host.json 元数据文件,其中包含影响所有功能的全局配置选项。 Script 运行时会在初始化主机时将这些设置映射到它们对应的 WebHobs SDK JobHostConfiguration 设置中。
那么 local.settings.json 和 project.json 有什么作用呢?
【问题讨论】:
标签: azure azure-functions