-
Notifications
You must be signed in to change notification settings - Fork 442
host.json (v2)
The schema for host.json
has changed enough in Azure Functions v2+ that the functions host will throw an exception if the file is missing the "version": "2.0"
property. Please note that this requires the value as a string and "version":2.0
will not work. "version": "2.0"
is still the valid schema for Azure Functions v3.
This page provides a migration guide for the sections that have changed. For full definitions of those sections, see https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json. The official documentation will be updated with the v2 schema soon.
This means that the following settings that were in the root of the json object in v1, now live under extensions
in v2:
{
"extensions": {
"cosmosDB": { },
"eventHubs": { },
"http": { },
"queues": { },
"sendGrid": { },
"serviceBus": { },
"durableTask": { }
}
}
This means that the "tracing"
and "logger"
have been removed.
{
"logging": {
"fileLoggingMode": { },
"applicationInsights": { }
}
}
Filtering now follows the same pattern as documented by the JSON settings here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1#log-filtering.
For example, the following will disable all logging except the logs coming from the function named 'MyFunction'
{
"logging": {
"logLevel": {
"Function.MyFunction": "Information",
"default": "None"
}
}
}
{
"version": "2.0",
"watchDirectories": [ "Shared", "Test" ],
"healthMonitor": {
"enabled": true,
"healthCheckInterval": "00:00:10",
"healthCheckWindow": "00:02:00",
"healthCheckThreshold": 6,
"counterThreshold": 0.80
},
"functionTimeout": "00:05:00",
"logging": {
"fileLoggingMode": "debugOnly"
},
"extensions": {
"cosmosDB": {
"connectionMode": "Gateway",
"protocol": "Https",
"leaseOptions": {
"leasePrefix": "prefix1"
}
},
"sendGrid": {
"from": "Azure Functions <[email protected]>"
},
"http": {
"routePrefix": "api",
"maxConcurrentRequests": 5,
"maxOutstandingRequests": 30
},
"queues": {
"visibilityTimeout": "00:00:10",
"maxPollingInterval": "00:00:15",
"maxDequeueCount": 3
},
"eventHubs": {
"batchCheckpointFrequency": 5,
"eventProcessorOptions": {
"maxBatchSize": 256,
"prefetchCount": 512
}
},
"serviceBus": {
"prefetchCount": 100,
"messageHandlerOptions": {
"maxConcurrentCalls": 32,
"maxAutoRenewDuration": "00:55:00"
}
}
}
}
- Configuration Settings
- function.json
- host.json
- host.json (v2)
- Http Functions
- Function Runtime Versioning
- Official Functions developers guide
- Host Health Monitor
- Managing Connections
- Renaming a Function
- Retrieving information about the currently running function
- Site Extension Resolution
- Linux Consumption Regions
- Using LinuxFxVersion for Linux Function apps
- Out-of-proc Cancellation Tokens
- Assembly Resolution in Azure Functions
- ILogger
- Precompiled functions
- Official Functions C# developer reference
- Contributor Onboarding
- Development Process
- Deploying the Functions runtime as a private site extension
- Authoring & Testing Language Extensions
- Bindings in out-of-proc
- Language Extensibility
- Worker Capabilities
- Investigating and reporting issues with timer triggered functions not firing
- Sharing Your Function App name privately
- Azure Functions CLI release notes [moved here]
- Function App Zipped Deployment [deprecated]