Azure / Azure/azure-functions-dotnet-worker

Suggestion: Improve error message when a function lacks any input bindings

Open
#1,201 1 comment 5 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

Currently, if any function (method decorated with the `FunctionAttribute`) in the project is missing an input binding, running the project via `func host start` just displays

```A host error has occurred during startup operation '47ee1d6f-61ed-409a-8ce8-f63cb1191a1b'.
Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader: At least one binding must be declared.
Failed to stop host instance '670440b8-1a5b-4f4e-bb65-2b4259c769d5'.
Microsoft.Azure.WebJobs.Host: The host has not yet started.
Value cannot be null. (Parameter 'provider')
```

This gives the impression (to me at least) that _no_ bindings were found for any function, rather than an issue with any one specific function.

Could the error message be improved to list the function(s) the error is being thrown for? Something like `Function 'xyz' is missing input bindings. At least one binding must be declared.`

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the startup failure with `func host start` using a C# method decorated with `FunctionAttribute` but no input binding. Trace the function metadata loading path to identify where the generic error is produced. Done means the startup error identifies each function missing input bindings while retaining the existing binding guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.