Azure-webjobs-sdk: Reconcile IJobActivator with DI

Created on 19 Sep 2018  路  5Comments  路  Source: Azure/azure-webjobs-sdk

When we did the DI work, we didn't reconcile the existing IJobActivator interface with DI. There are patterns that can be used to bridge the gap (e.g. see https://github.com/Azure/azure-webjobs-sdk/issues/1915) however, registration of a custom IJobActivator instance shouldn't be needed. Instead our activation channel should be able to just use the IServiceProvider to dynamically get instances as needed.

Most helpful comment

This issue shows closed, but I'm not quite seeing if DI is still natively supported? Is there an example of how to do dependency injection that works? I can't seem to get it going.

All 5 comments

Is this (first class DI for functions themselves) this expected for part of initial v2 GA release?

No unfortunately, it missed the cutoff. But we'll get it in soon.

@mathewc does the change mean having a static class to host functions is no longer the way to go?
Do we now need to pay attention to Functions object lifetime?

This issue shows closed, but I'm not quite seeing if DI is still natively supported? Is there an example of how to do dependency injection that works? I can't seem to get it going.

Also can't get it to work. Trying the sample but the constructor for Functions is not being called (which in turn makes all services null when trying to call them from triggered method).

@mathewc - Any comments on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shibayan picture shibayan  路  5Comments

hajekj picture hajekj  路  3Comments

nibras85 picture nibras85  路  3Comments

xt0rted picture xt0rted  路  5Comments

sergey-netdev picture sergey-netdev  路  5Comments