Skip to content

Generator doesn't warn when [FunctionName] is specified on a private function #619

@AtOMiCNebula

Description

@AtOMiCNebula

The Generator will happily generate a functions.json for code that the host can't handle. Specifically, code like this:

public class ExampleFunctions
{
    [FunctionName("Foo")]
    private void Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req)
    {
        // ...
    }
}

The Functions Host doesn't actually load the function because it's private (and reports a single trace log about it in App Insights, oy). Either the Generator should throw a warning/error in this case, or the host should enumerate private methods. Just need both parts to be consistent with each other. 😄

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