Skip to content

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

Open
@Francisco-Gamino

Description

@Francisco-Gamino

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.

private static readonly Action<ILogger, int, Exception> _functionMetadataManagerFunctionsLoaded =
LoggerMessage.Define<int>(LogLevel.Information,
new EventId(315, nameof(FunctionMetadataManagerFunctionsLoaded)),
"{count} functions loaded");

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions