title: Can I configure Autofac to use dependencies from my Azure Functions bindings?
body: <p>We use Autofac for our API projects. Porting out functions over has been on our todo list since Azure Functions announced support for Autofac. We already share a lot of services / repositories, but currently <code>new()</code> them up in the function body, which is a bit verbose.</p>
  
  <p>I took a swing at it today, but am finding that I'm just being more verbose elsewhere. Specifically, I realised that I was writing a lot of code to replicate the functionality offered by bindings.</p>
  
  <p>As an example, take the <code>[CosmosDB()]</code> binding attribute, which basically gives one a working, authenticated ("read-to-eat") <code>DocumentClient</code> in a single line.</p>
  
  <p>When I'm using Autofac, it's necessary to manually read several settings from the config and to initialise a KeyVault client, etc...</p>
  
  <p>Can I have my cake and eat it? Is there some way to register dependencies from my bindings so that they are available for Autofac to supply to my services etc.?</p>