Azure Functions - 拥有 host.json 和 local.settings.json 的目的是什么

标签 azure azure-functions

我可以看到 Azure Function 目录中已添加两个 json 文件(host.json 和 local.settings.json)。

host.json

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingExcludedTypes": "Request",
            "samplingSettings": {
                "isEnabled": true
            }
        }
    }
}

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  }
}

这两个json文件的用途是什么?

最佳答案

文档中的解释非常清楚,来自文档,

host.json

The host.json metadata file contains global configuration options that affect all functions for a function app. This article lists the settings that are available starting with version 2.x of the Azure Functions runtime.

Local settings

The local.settings.json file stores app settings, connection strings, and settings used by local development tools. Settings in the local.settings.json file are used only when you're running projects locally.

关于Azure Functions - 拥有 host.json 和 local.settings.json 的目的是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62669672/

相关文章:

java - azure 函数在 IntelliJ IDEA 中调试错误

azure-functions - 从函数应用访问虚拟网络中的 Cosmos DB

本地 Azure 函数 - 为什么使用 Docker 容器?

c# - 函数主机未运行

c# - Azure Durable Function App 跨事件方法的最佳状态管理实践是什么?

azure - 是否有函数 wwwroot 的相对路径的语法?

azure - 如何根据与 Azure 应用程序网关关联的 Azure WAF 策略上的 RequestUri 创建某些规则的排除列表?

azure - 从 Azure ARM 调用 Terraform

node.js - Azure Functions 未执行任何操作就超时

azure - "RequestsDependencyWarning: urllib3 (1.26.12) or chardet (3.0.4) doesn' t 与受支持的版本匹配!”在 Azure DevOps - Azure IoT Edge 任务 - 构建中