Dependency Injection for Azure Function
Enabling dependency injection on your Azure Function a little bit different than the usual process like you do on the .Net Core applications. Here I'm planning to share some tips and steps you should follow if you need to enable DI on Azure Functions with C#. I'm focusing on a function application created for HTTP Trigger. When you create a new project you will see a static class and method to run your function end-point. 1 2 3 4 5 6 7 8 9 10 11 public static class FunctionWithDI { [FunctionName("function-with-di")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { log.LogInformation( "C# HTTP trigger function processed...