Our Application makes heavy use of Autofac Per-Request-Dependencies. This works quite well and fits our needs.
Now we have an requirement to listen on AzureWebJobs.
Since im quite new to Azure WebJobs i followed this tutorial (Here the git-sources)
Now the tricky part.
Even though i followed all the instructions and created an AutofacActivator
Autofac seems not to be able to resolve my Per-Request registered dependencies
DependencyResolutionException: No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.
Question
Is there any way i can under above requirements make Autofac work together with Azure-WebJobs?
To be clear, my Autofaclistener resolves just one service. That cannot be registered as SingleInstance since it gets resolved on other services too. Also i can not change my Per-Request-Stuff to InstancePerLifetimeScope
as suggested here
I hope my issue and my question are self-explaining. If not , please let me know