Richard Fuller
Richard Fuller

Reputation: 474

How to add dependencies to Azure Function's HostBuilder

So Azure Functions’ SDK does use dependency injection internally to allow parameters to be automatically populated (such as logger). This is awesome however I’d like to inject my own types and my own configuration without having to write my own code to do this. I don’t see any way to access HostBuilder in the runtime. Is this possible? What’s the recommended way to use M.E.DependencyInjection, M.E.Configuration or Autofac in my function?

Upvotes: 1

Views: 1167

Answers (1)

Fabio Cavalcante
Fabio Cavalcante

Reputation: 12538

Function level DI support is something we’re working on, but not yet available.

You can track this issue to follow the progress: https://github.com/Azure/azure-functions-host/issues/3736

You’ll notice that the issue has been a little quiet and that was because of higher priority items we had to address, but we’re resuming this work.

Upvotes: 1

Related Questions