Azure / Azure/azure-functions-host

Seems HostMonitor option in host.json not working at all

Open
#9,542 0 comments 0 reactions 0 assignees View on GitHub
needs-investigation
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

#### Check for a solution in the Azure portal
For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select `Diagnose and solve problems` from the left, and view relevant dashboards before opening your issue.

By setting `"healthMonitor": { "enabled": false }` we still got Host shutdown due to unhealthy.
By static code review, it seems you doesn't consume `host.json` in WebJobs host, but only consume they in ScriptHost:
https://github.com/Azure/azure-functions-host/blob/0120ead6bbf821ffa8bac7f9ddd8b57458ccce43/src/WebJobs.Script/ScriptHostBuilderExtensions.cs#L104
This `HostJsonFileConfigurationSource` was only added in `DefaultScriptHostBuilder.BuildHost` but not added in WebJobsScript, and therefore the healthMonitorOptions could not get configuration from host.json at all.
https://github.com/Azure/azure-functions-host/blob/0120ead6bbf821ffa8bac7f9ddd8b57458ccce43/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs#L82

#### Investigative information

Please provide the following:

- Timestamp:
- Function App version:
- Function App name:
- Function name(s) (as appropriate):
- Invocation ID:
- Region:

#### Repro steps

Provide the steps required to reproduce the problem:

#### Expected behavior

Provide a description of the expected behavior.

#### Actual behavior

Provide a description of the actual behavior observed.

#### Known workarounds

Provide a description of any known workarounds.

#### Related information

Provide any related information

* Programming language used
* Links to source
* Bindings used

Contributor guide

Open the contributing guide

Research direction

Start by reading the configuration setup in src/WebJobs.Script/ScriptHostBuilderExtensions.cs around the linked line, then compare it with src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs. Trace how host.json reaches healthMonitorOptions and verify that setting healthMonitor.enabled to false prevents shutdown due to an unhealthy host; add or run the relevant regression coverage if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.