Azure Functions 中 .json 文件的用途是什么?

What is the purpose of the .json files in Azure Functions?

好像有很多类型,虽然有些项目只有其中一两个。

在 Visual Studio 预览中创建一个新函数,它会为您提供 host.jsonlocal.settings.json.

I've also seen projectsfunction.jsonproject.json

The Function docs 说明 function.json 的用途:

The function.json file defines the function bindings and other configuration settings. The runtime uses this file to determine the events to monitor and how to pass data into and return data from function execution.

一个例子:

{
    "disabled": false,
    "bindings": [
        // ... bindings here
        {
            "type": "bindingType",
            "direction": "in",
            "name": "myParamName",
            // ... more depending on binding
        }
    ]
}

host.json也有目的,per the Azure webjobs SDK:

In the root script directory, there should be a host.json metadata file that contains the global configuration options affecting all functions. The Script runtime will map these settings into their corresponding WebHobs SDK JobHostConfiguration settings when initializing the host.

那么local.settings.jsonproject.json有什么作用呢?

local.settings.json 是存储本地开发环境的应用程序设置,参见Local settings file。生产设置将从 Azure 环境配置中获取。

project.json 是引用您的函数使用的任何自定义 NuGet 包,请参阅