Azure / Azure/azure-functions-host

Add additional logging to state whether the function app has content (to debug `'0 functions loaded'`) when starting the Functions Host

Open
#9,515 2 comments 0 reactions 0 assignees View on GitHub
supportability
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

Currently, we do not have a simple way to debug the `'0 functions loaded'` message. This log entry typically indicates that the Functions Host was unable to find and load any functions within the function app project.

If the function app has content, this means that there is a problem with the package (content); otherwise, the issue is that there is no content, and this message is expected.

Current logging:

Source | Summary
-- | --
Host.Startup | Loading functions metadata
Microsoft.Azure.WebJobs.Script.HostFunctionMetadataProvider | Reading functions metadata
Microsoft.Azure.WebJobs.Script.HostFunctionMetadataProvider | 0 functions found
Host.Startup | 0 functions loaded

Additionally, we should create documentation that describes how to debug the `'0 functions loaded'` message, which is very specific to the type of runtime (`Dotnet`, `Dotnet-Isolated`, `NodeJs`, `Java`, `PowerShell`, and `Python`). This new documentation should contain debugging instructions for both the V1 and V2 programming models if applicable.

If the function app has content, we should do one of the following:

1) Create a diagnostic event that indicates there is a problem with the function app package, and the Functions Host is unable to find and load any functions.

https://github.com/Azure/azure-functions-host/blob/88b610c61a6dc39e053f5fe7f902204e06aa1b41/src/WebJobs.Script/Diagnostics/Extensions/LoggerExtension.cs#L89-L92

2) Update the existing log to include a fwlink that directs users to documentation on how to resolve this issue, for example,
`https://aka.ms/function-app-invalid-content`.

One more thing to consider: If the app has no content, perhaps we should append additional guidance to the `'0 functions loaded'` message, providing information on how to deploy content to the function app.

/cc @FinVamp1 @sidkri @paulyuk @vrdmr @mattchenderson @fabiocav

Contributor guide

Open the contributing guide

Research direction

Start with src/WebJobs.Script/Diagnostics/Extensions/LoggerExtension.cs at lines 89-92 and trace the existing Host.Startup and HostFunctionMetadataProvider logging around '0 functions loaded'. Compare the listed Dotnet, Dotnet-Isolated, NodeJs, Java, PowerShell, and Python runtime and V1/V2 cases. Done means the host distinguishes apps with and without content and the debugging documentation covers the applicable cases and guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud, documentation, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.