Instantly share code, notes, and snippets.

What would you like to do?
Azure Functions with IoC Container
public static class IndexHttpTrigger
public static IFunctionFactory FunctionFactory { get; set; } = new FunctionFactory();
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "pets")]HttpRequestMessage req,
TraceWriter log)
AglCodingTestHttpTriggerFunctionOptions options = GetOptions(req);
var res = await FunctionFactory.Create<IAglCodingTestHttpTriggerFunction>(log)
.InvokeAsync(req, options)
return res as HttpResponseMessage;
catch (Exception ex)
return req.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment