您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Azure Functions 1.x 的 host.json 参考host.json reference for Azure Functions 1.x

host.json 元数据文件包含对函数应用的所有函数产生影响的全局配置选项。The host.json metadata file contains global configuration options that affect all functions for a function app. 本文列出了可用于 v1 运行时的设置。This article lists the settings that are available for the v1 runtime. JSON 架构位于 http://json.schemastore.org/hostThe JSON schema is at http://json.schemastore.org/host.

备注

本文适用于 Azure Functions 1.x。This article is for Azure Functions 1.x. 有关 Functions 2.x 中 host.json 的参考,请参阅 Azure Functions 2.x 的 host.json 参考For a reference of host.json in Functions 2.x, see host.json reference for Azure Functions 2.x.

其他函数应用配置选项是在你的应用设置中管理的。Other function app configuration options are managed in your app settings.

local.settings.json 文件中的某些 host.json 设置仅在本地运行时才使用。Some host.json settings are only used when running locally in the local.settings.json file.

示例 host.json 文件Sample host.json file

以下示例 host.json 文件指定了所有可能的选项。The following sample host.json files have all possible options specified.

{
    "aggregator": {
        "batchSize": 1000,
        "flushTimeout": "00:00:30"
    },
    "applicationInsights": {
        "sampling": {
          "isEnabled": true,
          "maxTelemetryItemsPerSecond" : 5
        }
    },
    "eventHub": {
      "maxBatchSize": 64,
      "prefetchCount": 256,
      "batchCheckpointFrequency": 1
    },
    "functions": [ "QueueProcessor", "GitHubWebHook" ],
    "functionTimeout": "00:05:00",
    "healthMonitor": {
        "enabled": true,
        "healthCheckInterval": "00:00:10",
        "healthCheckWindow": "00:02:00",
        "healthCheckThreshold": 6,
        "counterThreshold": 0.80
    },
    "http": {
        "routePrefix": "api",
        "maxOutstandingRequests": 20,
        "maxConcurrentRequests": 10,
        "dynamicThrottlesEnabled": false
    },
    "id": "9f4ea53c5136457d883d685e57164f08",
    "logger": {
        "categoryFilter": {
            "defaultLevel": "Information",
            "categoryLevels": {
                "Host": "Error",
                "Function": "Error",
                "Host.Aggregator": "Information"
            }
        }
    },
    "queues": {
      "maxPollingInterval": 2000,
      "visibilityTimeout" : "00:00:30",
      "batchSize": 16,
      "maxDequeueCount": 5,
      "newBatchThreshold": 8
    },
    "serviceBus": {
      "maxConcurrentCalls": 16,
      "prefetchCount": 100,
      "autoRenewTimeout": "00:05:00"
    },
    "singleton": {
      "lockPeriod": "00:00:15",
      "listenerLockPeriod": "00:01:00",
      "listenerLockRecoveryPollingInterval": "00:01:00",
      "lockAcquisitionTimeout": "00:01:00",
      "lockAcquisitionPollingInterval": "00:00:03"
    },
    "tracing": {
      "consoleLevel": "verbose",
      "fileLoggingMode": "debugOnly"
    },
    "watchDirectories": [ "Shared" ],
}

本文的以下各部分解释了每个顶级属性。The following sections of this article explain each top-level property. 除非另有说明,否则其中的所有属性都是可选的。All are optional unless otherwise indicated.

aggregatoraggregator

指定在计算 Application Insights 的指标时要聚合多少个函数调用。Specifies how many function invocations are aggregated when calculating metrics for Application Insights.

{
    "aggregator": {
        "batchSize": 1000,
        "flushTimeout": "00:00:30"
    }
}
属性Property 默认Default 描述Description
batchSizebatchSize 10001000 要聚合的最大请求数。Maximum number of requests to aggregate.
flushTimeoutflushTimeout 00:00:3000:00:30 要聚合的最大时间段。Maximum time period to aggregate.

达到两个限制中的第一个限制时,会聚合函数调用。Function invocations are aggregated when the first of the two limits are reached.

applicationInsightsapplicationInsights

控制 Application Insights 中的采样功能Controls the sampling feature in Application Insights.

{
    "applicationInsights": {
        "sampling": {
          "isEnabled": true,
          "maxTelemetryItemsPerSecond" : 5
        }
    }
}
属性Property 默认Default 描述Description
isEnabledisEnabled truetrue 启用或禁用采样。Enables or disables sampling.
maxTelemetryItemsPerSecondmaxTelemetryItemsPerSecond 55 开始采样所要达到的阈值。The threshold at which sampling begins.

durableTaskdurableTask

Durable Functions 的配置设置。Configuration settings for Durable Functions.

{
  "durableTask": {
    "hubName": "MyTaskHub",
    "controlQueueBatchSize": 32,
    "partitionCount": 4,
    "controlQueueVisibilityTimeout": "00:05:00",
    "workItemQueueVisibilityTimeout": "00:05:00",
    "maxConcurrentActivityFunctions": 10,
    "maxConcurrentOrchestratorFunctions": 10,
    "maxQueuePollingInterval": "00:00:30",
    "azureStorageConnectionStringName": "AzureWebJobsStorage",
    "trackingStoreConnectionStringName": "TrackingStorage",
    "trackingStoreNamePrefix": "DurableTask",
    "traceInputsAndOutputs": false,
    "logReplayEvents": false,
    "eventGridTopicEndpoint": "https://topic_name.westus2-1.eventgrid.azure.net/api/events",
    "eventGridKeySettingName":  "EventGridKey",
    "eventGridPublishRetryCount": 3,
    "eventGridPublishRetryInterval": "00:00:30",
    "eventGridPublishEventTypes": ["Started", "Completed", "Failed", "Terminated"]
  }
}

任务中心名称必须以字母开头且只能包含字母和数字。Task hub names must start with a letter and consist of only letters and numbers. 如果未指定,则函数应用的默认任务中心名称是 DurableFunctionsHubIf not specified, the default task hub name for a function app is DurableFunctionsHub. 有关详细信息,请参阅任务中心For more information, see Task hubs.

属性Property 默认Default 描述Description
hubNamehubName DurableFunctionsHubDurableFunctionsHub 可以使用备用任务中心名称将多个 Durable Functions 应用程序彼此隔离,即使这些应用程序使用同一存储后端。Alternate task hub names can be used to isolate multiple Durable Functions applications from each other, even if they're using the same storage backend.
controlQueueBatchSizecontrolQueueBatchSize 3232 要从控制队列中一次性拉取的消息数。The number of messages to pull from the control queue at a time.
partitionCountpartitionCount 44 控制队列的分区计数。The partition count for the control queue. 可以是 1 到 16 之间的正整数。May be a positive integer between 1 and 16.
controlQueueVisibilityTimeoutcontrolQueueVisibilityTimeout 5 分钟5 minutes 已取消排队的控制队列消息的可见性超时。The visibility timeout of dequeued control queue messages.
workItemQueueVisibilityTimeoutworkItemQueueVisibilityTimeout 5 分钟5 minutes 已取消排队的工作项队列消息的可见性超时。The visibility timeout of dequeued work item queue messages.
maxConcurrentActivityFunctionsmaxConcurrentActivityFunctions 10 倍于当前计算机上的处理器数10X the number of processors on the current machine 可以在单个主机实例上并发处理的活动函数的最大数目。The maximum number of activity functions that can be processed concurrently on a single host instance.
maxConcurrentOrchestratorFunctionsmaxConcurrentOrchestratorFunctions 10 倍于当前计算机上的处理器数10X the number of processors on the current machine 可以在单个主机实例上并发处理的业务流程协调程序函数的最大数目。The maximum number of orchestrator functions that can be processed concurrently on a single host instance.
maxQueuePollingIntervalmaxQueuePollingInterval 30 秒30 seconds 最大的控制和工作项队列轮询时间间隔,采用 hh:mm:ss 格式。The maximum control and work-item queue polling interval in the hh:mm:ss format. 值越高,可能导致的消息处理延迟也越高。Higher values can result in higher message processing latencies. 值越低,可能导致的存储成本会越高,因为存储事务数增高。Lower values can result in higher storage costs because of increased storage transactions.
azureStorageConnectionStringNameazureStorageConnectionStringName AzureWebJobsStorageAzureWebJobsStorage 应用设置的名称,其中的 Azure 存储连接字符串用于管理基础的 Azure 存储资源。The name of the app setting that has the Azure Storage connection string used to manage the underlying Azure Storage resources.
trackingStoreConnectionStringNametrackingStoreConnectionStringName 连接字符串的名称,用于“历史记录”和“实例”表。The name of a connection string to use for the History and Instances tables. 如果未指定,则使用 azureStorageConnectionStringName 连接。If not specified, the azureStorageConnectionStringName connection is used.
trackingStoreNamePrefixtrackingStoreNamePrefix 指定 trackingStoreConnectionStringName 时用于“历史记录”和“实例”表的前缀。The prefix to use for the History and Instances tables when trackingStoreConnectionStringName is specified. 如果未设置,则默认前缀值为 DurableTaskIf not set, the default prefix value will be DurableTask. 如果 trackingStoreConnectionStringName 未指定,则“历史记录”和“实例”表会使用 hubName 值作为其前缀,trackingStoreNamePrefix 的任何设置都会被忽略。If trackingStoreConnectionStringName is not specified, then the History and Instances tables will use the hubName value as their prefix, and any setting for trackingStoreNamePrefix will be ignored.
traceInputsAndOutputstraceInputsAndOutputs falsefalse 一个指示是否跟踪函数调用的输入和输出的值。A value indicating whether to trace the inputs and outputs of function calls. 跟踪函数执行事件时的默认行为是在函数调用的序列化输入和输出中包括字节数。The default behavior when tracing function execution events is to include the number of bytes in the serialized inputs and outputs for function calls. 此行为提供的有关输入和输出情况的信息是最少的,不会导致日志膨胀,也不会无意中将敏感信息公开。This behavior provides minimal information about what the inputs and outputs look like without bloating the logs or inadvertently exposing sensitive information. 将此属性设置为 true 会导致默认函数日志记录将函数输入和输出的整个内容都记录下来。Setting this property to true causes the default function logging to log the entire contents of function inputs and outputs.
logReplayEventslogReplayEvents falsefalse 一个值,该值指示是否将业务流程重播事件写入到 Application Insights。A value indicating whether to write orchestration replay events to Application Insights.
eventGridTopicEndpointeventGridTopicEndpoint Azure 事件网格自定义主题终结点的 URL。The URL of an Azure Event Grid custom topic endpoint. 在设置此属性,业务流程生命周期通知事件发布到此终结点。When this property is set, orchestration life-cycle notification events are published to this endpoint. 此属性支持应用设置解析。This property supports App Settings resolution.
eventGridKeySettingNameeventGridKeySettingName 应用设置的名称,该设置包含的密钥用于在 EventGridTopicEndpoint 上通过 Azure 事件网格自定义主题进行身份验证。The name of the app setting containing the key used for authenticating with the Azure Event Grid custom topic at EventGridTopicEndpoint.
eventGridPublishRetryCounteventGridPublishRetryCount 00 发布到事件网格主题失败时要重试的次数。The number of times to retry if publishing to the Event Grid Topic fails.
eventGridPublishRetryIntervaleventGridPublishRetryInterval 5 分钟5 minutes 事件网格发布重试间隔(采用 hh:mm:ss 格式)。The Event Grid publishes retry interval in the hh:mm:ss format.
eventGridPublishEventTypeseventGridPublishEventTypes 若要将发布到事件网格的事件类型的列表。A list of event types to publish to Event Grid. 如果未指定,将发布所有事件类型。If not specified, all event types will be published. 允许值包括StartedCompletedFailedTerminatedAllowed values include Started, Completed, Failed, Terminated.

许多此类设置用于优化性能。Many of these settings are for optimizing performance. 有关详细信息,请参阅性能和缩放For more information, see Performance and scale.

eventHubeventHub

事件中心触发器和绑定的配置设置。Configuration settings for Event Hub triggers and bindings.

{
    "eventHub": {
      "maxBatchSize": 64,
      "prefetchCount": 256,
      "batchCheckpointFrequency": 1
    }
}
属性Property 默认Default 描述Description
maxBatchSizemaxBatchSize 6464 每个接收循环收到的最大事件计数。The maximum event count received per receive loop.
prefetchCountprefetchCount 不适用n/a 基础 EventProcessorHost 将要使用的默认 PrefetchCount。The default PrefetchCount that will be used by the underlying EventProcessorHost.
batchCheckpointFrequencybatchCheckpointFrequency 1 创建 EventHub 游标检查点之前要处理的事件批数。The number of event batches to process before creating an EventHub cursor checkpoint.

functionsfunctions

作业主机运行的函数列表。A list of functions that the job host runs. 空数组表示运行所有函数。An empty array means run all functions. 仅供在本地运行时使用。Intended for use only when running locally. 在 Azure 的函数应用中,应改为按照如何在 Azure Functions 中禁用函数中的步骤禁用特定函数,而不是使用此设置。In function apps in Azure, you should instead follow the steps in How to disable functions in Azure Functions to disable specific functions rather than using this setting.

{
    "functions": [ "QueueProcessor", "GitHubWebHook" ]
}

functionTimeoutfunctionTimeout

指示所有函数的超时持续时间。Indicates the timeout duration for all functions. 在无服务器消耗计划中,有效范围为 1 秒至 10 分钟,默认值为 5 分钟。In a serverless Consumption plan, the valid range is from 1 second to 10 minutes, and the default value is 5 minutes. 在应用服务计划中,没有总体限制,默认值取决于运行时版本。In an App Service plan, there is no overall limit and the default depends on the runtime version.

{
    "functionTimeout": "00:05:00"
}

healthMonitorhealthMonitor

主机运行状况监视器的配置设置。Configuration settings for Host health monitor.

{
    "healthMonitor": {
        "enabled": true,
        "healthCheckInterval": "00:00:10",
        "healthCheckWindow": "00:02:00",
        "healthCheckThreshold": 6,
        "counterThreshold": 0.80
    }
}
属性Property 默认Default 描述Description
enabledenabled truetrue 指定是否已启用该功能。Specifies whether the feature is enabled.
healthCheckIntervalhealthCheckInterval 10 秒10 seconds 定期后台运行状况检查之间的时间间隔。The time interval between the periodic background health checks.
healthCheckWindowhealthCheckWindow 2 分钟2 minutes healthCheckThreshold 设置结合使用的滑动时间窗口。A sliding time window used in conjunction with the healthCheckThreshold setting.
healthCheckThresholdhealthCheckThreshold 66 在启动主机回收之前,运行状况检查可以失败的最大次数。Maximum number of times the health check can fail before a host recycle is initiated.
counterThresholdcounterThreshold 0.800.80 性能计数器将被视为不正常的阈值。The threshold at which a performance counter will be considered unhealthy.

httphttp

http 触发器和绑定的配置设置。Configuration settings for http triggers and bindings.

{
    "http": {
        "routePrefix": "api",
        "maxOutstandingRequests": 200,
        "maxConcurrentRequests": 100,
        "dynamicThrottlesEnabled": true
    }
}
属性Property 默认Default 描述Description
routePrefixroutePrefix apiapi 应用到所有路由的路由前缀。The route prefix that applies to all routes. 使用空字符串可删除默认前缀。Use an empty string to remove the default prefix.
maxOutstandingRequestsmaxOutstandingRequests 200*200* 在任意给定时间搁置的未完成请求数上限。The maximum number of outstanding requests that are held at any given time. 此限制包括已排队但尚未开始执行的请求,以及正在执行的所有请求。This limit includes requests that are queued but have not started executing, as well as any in progress executions. 超出此限制的任何传入请求将被拒绝,并返回 429“太忙”响应。Any incoming requests over this limit are rejected with a 429 "Too Busy" response. 允许调用方使用基于时间的重试策略,还可帮助控制最大请求延迟。That allows callers to employ time-based retry strategies, and also helps you to control maximum request latencies. 此设置仅控制脚本宿主执行路径中发生的排队。This only controls queuing that occurs within the script host execution path. 其他队列(例如 ASP.NET 请求队列)仍有效,不受此设置的影响。Other queues such as the ASP.NET request queue will still be in effect and unaffected by this setting. *版本 1.x 的默认值是无限制的 (-1)。*The default for version 1.x is unbounded (-1). 消耗计划中版本 2.x 的默认值为 200。The default for version 2.x in a consumption plan is 200. 专用计划中版本 2.x 的默认值是无限制的 (-1)。The default for version 2.x in a dedicated plan is unbounded (-1).
maxConcurrentRequestsmaxConcurrentRequests 100*100* 要并行执行的 http 函数数目上限。The maximum number of http functions that will be executed in parallel. 这样,可以控制并发性,从而帮助管理资源利用率。This allows you to control concurrency, which can help manage resource utilization. 例如,某个 http 函数可能使用了大量系统资源(内存/CPU/插槽),从而在并发性过高时导致问题。For example, you might have an http function that uses a lot of system resources (memory/cpu/sockets) such that it causes issues when concurrency is too high. 或者,某个函数向第三方服务发出出站请求,则可能需要限制这些调用的速率。Or you might have a function that makes outbound requests to a third party service, and those calls need to be rate limited. 在这种情况下,应用限制可能有帮助。In these cases, applying a throttle here can help. *版本 1.x 的默认值是无限制的 (-1)。*The default for version 1.x is unbounded (-1). 消耗计划中版本 2.x 的默认值为 100。The default for version 2.x in a consumption plan is 100. 专用计划中版本 2.x 的默认值是无限制的 (-1)。The default for version 2.x in a dedicated plan is unbounded (-1).
dynamicThrottlesEnableddynamicThrottlesEnabled true*true* 启用时,将为此设置将导致请求处理管道,以定期检查系统性能计数器类似连接/线程/进程/内存/CPU 等,并通过内置的高阈值 (80%),如果有任何这些计数器请求拒绝与 429“太忙”响应,直至恢复到正常水平的计数器。When enabled, this setting causes the request processing pipeline to periodically check system performance counters like connections/threads/processes/memory/cpu/etc. and if any of those counters are over a built-in high threshold (80%), requests will be rejected with a 429 "Too Busy" response until the counter(s) return to normal levels. *版本 1.x 的默认值是 false。*The default for version 1.x is false. 消耗计划中版本 2.x 的默认值为 true。The default for version 2.x in a consumption plan is true. 专用计划中版本 2.x 的默认值为 false。The default for version 2.x in a dedicated plan is false.

idid

仅限版本 1.xVersion 1.x only.

作业宿主的唯一 ID。The unique ID for a job host. 可以是不带短划线的小写 GUID。Can be a lower case GUID with dashes removed. 在本地运行时必须指定。Required when running locally. 在 Azure 中运行时,我们建议你不要设置 ID 值。When running in Azure, we recommend that you not set an ID value. 当省略 id 时,会自动在 Azure 中生成 ID。An ID is generated automatically in Azure when id is omitted.

如果跨多个函数应用共享存储帐户,请确保每个函数应用都有不同的 idIf you share a Storage account across multiple function apps, make sure that each function app has a different id. 可省略 id 属性或手动将每个函数应用的 id 设置为不同的值。You can omit the id property or manually set each function app's id to a different value. 计时器触发器使用存储锁来确保当函数应用横向扩展到多个实例时将只有一个计时器实例。The timer trigger uses a storage lock to ensure that there will be only one timer instance when a function app scales out to multiple instances. 如果两个函数应用共享相同的 id 且每个都使用计时器触发器,则只会运行一个计时器。If two function apps share the same id and each uses a timer trigger, only one timer will run.

{
    "id": "9f4ea53c5136457d883d685e57164f08"
}

loggerlogger

控制 ILogger 对象context.log 写入的日志的筛选。Controls filtering for logs written by an ILogger object or by context.log.

{
    "logger": {
        "categoryFilter": {
            "defaultLevel": "Information",
            "categoryLevels": {
                "Host": "Error",
                "Function": "Error",
                "Host.Aggregator": "Information"
            }
        }
    }
}
属性Property 默认Default 描述Description
categoryFiltercategoryFilter 不适用n/a 指定按类别进行筛选Specifies filtering by category
defaultLeveldefaultLevel InformationInformation 对于 categoryLevels 数组中未指定的任何类别,会将此级别和更高级别的日志发送到 Application Insights。For any categories not specified in the categoryLevels array, send logs at this level and above to Application Insights.
categoryLevelscategoryLevels 不适用n/a 一个类别数组,指定每个类别的、要发送到 Application Insights 的最低日志级别。An array of categories that specifies the minimum log level to send to Application Insights for each category. 此处指定的类别控制以相同值开头的所有类别,较长的值优先。The category specified here controls all categories that begin with the same value, and longer values take precedence. 在前面的示例 host.json 文件中,将在 Information 级别记录以“Host.Aggregator”开头的所有类别的日志。In the preceding sample host.json file, all categories that begin with "Host.Aggregator" log at Information level. Error 级别记录以“Host”开头的其他所有类别(例如“Host.Executor”)的日志。All other categories that begin with "Host", such as "Host.Executor", log at Error level.

queuesqueues

存储队列触发器和绑定的配置设置。Configuration settings for Storage queue triggers and bindings.

{
    "queues": {
      "maxPollingInterval": 2000,
      "visibilityTimeout" : "00:00:30",
      "batchSize": 16,
      "maxDequeueCount": 5,
      "newBatchThreshold": 8
    }
}
属性Property 默认Default 描述Description
maxPollingIntervalmaxPollingInterval 6000060000 队列轮询的最大间隔时间,以毫秒为单位。The maximum interval in milliseconds between queue polls.
visibilityTimeoutvisibilityTimeout 00 消息处理失败时的重试间隔时间。The time interval between retries when processing of a message fails.
batchSizebatchSize 1616 Functions 运行时同时检索并并行处理的队列消息数。The number of queue messages that the Functions runtime retrieves simultaneously and processes in parallel. 当处理的数量下降到 newBatchThreshold 时,运行时可获取另一个批,并开始处理这些消息。When the number being processed gets down to the newBatchThreshold, the runtime gets another batch and starts processing those messages. 因此,每个函数处理的最大并发消息数是 batchSize 加上 newBatchThresholdSo the maximum number of concurrent messages being processed per function is batchSize plus newBatchThreshold. 此限制分别应用于各个队列触发的函数。This limit applies separately to each queue-triggered function.

如果要避免对队列上收到的消息并行执行,可以将 batchSize 设置为 1。If you want to avoid parallel execution for messages received on one queue, you can set batchSize to 1. 但是,只有在函数于单个虚拟机 (VM) 上运行时,此设置才可消除并发。However, this setting eliminates concurrency only so long as your function app runs on a single virtual machine (VM). 如果函数应用横向扩展到多个 VM,每个 VM 可运行每个队列触发的函数的一个实例。If the function app scales out to multiple VMs, each VM could run one instance of each queue-triggered function.

batchSize 的最大值为 32。The maximum batchSize is 32.
maxDequeueCountmaxDequeueCount 55 在将某个消息移到有害队列之前,尝试处理该消息的次数。The number of times to try processing a message before moving it to the poison queue.
newBatchThresholdnewBatchThreshold batchSize/2batchSize/2 只要同时处理的消息数下降到此数值,运行时即检索另一个批次。Whenever the number of messages being processed concurrently gets down to this number, the runtime retrieves another batch.

serviceBusserviceBus

服务总线触发器和绑定的配置设置。Configuration setting for Service Bus triggers and bindings.

{
    "serviceBus": {
      "maxConcurrentCalls": 16,
      "prefetchCount": 100,
      "autoRenewTimeout": "00:05:00"
    }
}
属性Property 默认Default 描述Description
maxConcurrentCallsmaxConcurrentCalls 1616 消息泵应该对回调发起的最大并发调用数。The maximum number of concurrent calls to the callback that the message pump should initiate. 默认情况下,Functions 运行时同时处理多条消息。By default, the Functions runtime processes multiple messages concurrently. 若要指示运行时一次只处理单个队列或主题消息,请将 maxConcurrentCalls 设置为 1。To direct the runtime to process only a single queue or topic message at a time, set maxConcurrentCalls to 1.
prefetchCountprefetchCount 不适用n/a 基础 MessageReceiver 将要使用的默认 PrefetchCount。The default PrefetchCount that will be used by the underlying MessageReceiver.
autoRenewTimeoutautoRenewTimeout 00:05:0000:05:00 自动续订消息锁的最长持续时间。The maximum duration within which the message lock will be renewed automatically.

singletonsingleton

单一实例锁行为的配置设置。Configuration settings for Singleton lock behavior. 有关详细信息,请参阅有关单一实例支持的 GitHub 问题For more information, see GitHub issue about singleton support.

{
    "singleton": {
      "lockPeriod": "00:00:15",
      "listenerLockPeriod": "00:01:00",
      "listenerLockRecoveryPollingInterval": "00:01:00",
      "lockAcquisitionTimeout": "00:01:00",
      "lockAcquisitionPollingInterval": "00:00:03"
    }
}
属性Property 默认Default 描述Description
lockPeriodlockPeriod 00:00:1500:00:15 占用函数级锁的时间段。The period that function level locks are taken for. 锁自动续订。The locks auto-renew.
listenerLockPeriodlistenerLockPeriod 00:01:0000:01:00 占用侦听器锁的时间段。The period that listener locks are taken for.
listenerLockRecoveryPollingIntervallistenerLockRecoveryPollingInterval 00:01:0000:01:00 在启动时无法获取侦听器锁的情况下,用于恢复侦听器锁的时间间隔。The time interval used for listener lock recovery if a listener lock couldn't be acquired on startup.
lockAcquisitionTimeoutlockAcquisitionTimeout 00:01:0000:01:00 运行时尝试获取锁的最长时间。The maximum amount of time the runtime will try to acquire a lock.
lockAcquisitionPollingIntervallockAcquisitionPollingInterval 不适用n/a 尝试获取锁的间隔时间。The interval between lock acquisition attempts.

tracingtracing

版本 1.xVersion 1.x

使用 TraceWriter 对象创建的日志的配置设置。Configuration settings for logs that you create by using a TraceWriter object. 请参阅 C# 日志记录Node.js 日志记录See C# Logging and Node.js Logging.

{
    "tracing": {
      "consoleLevel": "verbose",
      "fileLoggingMode": "debugOnly"
    }
}
属性Property 默认Default 描述Description
consoleLevelconsoleLevel infoinfo 控制台日志记录的跟踪级别。The tracing level for console logging. 选项包括:offerrorwarninginfoverboseOptions are: off, error, warning, info, and verbose.
fileLoggingModefileLoggingMode debugOnlydebugOnly 文件日志记录的跟踪级别。The tracing level for file logging. 选项包括 neveralwaysdebugOnlyOptions are never, always, debugOnly.

watchDirectorieswatchDirectories

应该监视其更改情况的一组共享代码目录A set of shared code directories that should be monitored for changes. 确保当这些目录中的代码发生更改时,函数会拾取这些更改。Ensures that when code in these directories is changed, the changes are picked up by your functions.

{
    "watchDirectories": [ "Shared" ]
}

后续步骤Next steps