I have an Azure Functions app.
I was surprised to learn that when defining a Azure WebJob function the HttpTriggerAttribute does not have to be applied to a HttpRequest parameter.
So while this is valid, and matches most tutorials and examples,
[FunctionName("get")] public async Task<IActionResult> Get( [HttpTrigger(AuthorizationLevel.Anonymous, nameof(HttpMethods.Get), Route = "api/get")]HttpRequest httpRequest) This is also valid,
[FunctionName("post")] public async Task<IActionResult> Post( [HttpTrigger(AuthorizationLevel.Anonymous, nameof(HttpMethods.Post), Route = "api/post")]MyType body) Since the attribute is not tied to a HttpRequest parameter, I'm surprised the attribute is a parameter attribute and not a method attribute like,
[FunctionName("post")] [HttpTrigger(AuthorizationLevel.Anonymous, nameof(HttpMethods.Post), Route = "api/post")] public async Task<IActionResult> Post(MyType body) Why is the HttpTriggerAttribute implemented as a parameter attribute and not a method attribute like FunctionNameAttribute?