简体   繁体   中英

Azure functions V2 startup method not firing

I'm trying to setup dependency injection with Azure functions but for whatever reason I can't get the web jobs start up method to fire.

[assembly: WebJobsStartup(typeof(PersonalBlog.Functions.Content.RefreshContentStartup))]
namespace PersonalBlog.Functions.Content { 
    public class RefreshContentStartup : IWebJobsStartup {
        public void Configure(IWebJobsBuilder builder) { }
    }
}

The project is .net Framework 4.7.1 due to the fact that it has a dependency on a few libraries that haven't been converted to dot net core yet...

Is there something I'm missing here? Do I have to add a setting for it to pick up on my startup file?

As @Kirklarkin and @silent mentionned, Azure Functions v2 supports .NET Core whereas Azure Functions v1 supports .NET Framework. You can't run Azure Functions on any languages/runtime, there is a list of supported languages with the associated runtimes. The point of using Azure Functions is mostly to do serverless which means autoscaling, no infrastructure to manage, and paying resources per use.

Concerning dependency injection, it is not supported out-of-the box in Azure Functions at the time of writing but the team is currently implementing it and it's one of their top priorities so we should have it soon .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM