In my organization I am noticing that people are keep on adding different endpoints in same function.cs file provided by azure. I am wondering is this correct approach for exponentially growing code?
For example code is going like below with RunFunction1 & RunFunction2.
public static class Functions
{
[FunctionName("Function1")]
public static IActionResult RunFunction1(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "function1")] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult("Hello from Function1");
}
[FunctionName("Function2")]
public static IActionResult RunFunction2(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "function2")] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult("Hello from Function2");
}
}