Azure Functions Dependency Injection with Autofac

added by DotNetKicks
10/25/2018 4:19:23 AM

2 Kicks, 975 Views

This post refers specifically to Azure Function V2. If you want to write automated tests for Azure Functions methods and want to be able to control dependencies (e.g. to inject mock versions of things) you can set up dependency injection. One way to do this is to install the AzureFunctions.Autofac NuGet package into your functions project.