简体   繁体   English

Azure函数V2启动方法未触发

[英]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. 我正在尝试使用Azure函数设置依赖项注入,但是出于任何原因,我都无法启动Web作业启动方法。

[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... 该项目是.net Framework 4.7.1,因为它依赖于一些尚未转换为点网核心的库...

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. 如@Kirklarkin和@silent所述,Azure Functions v2支持.NET Core,而Azure Functions v1支持.NET Framework。 You can't run Azure Functions on any languages/runtime, there is a list of supported languages with the associated runtimes. 您不能在任何语言/运行时上运行Azure函数,其中列出了支持的语言以及相关联的运行时。 The point of using Azure Functions is mostly to do serverless which means autoscaling, no infrastructure to manage, and paying resources per use. 使用Azure Functions的主要目的是实现无服务器,这意味着自动缩放,无需管理基础结构并按使用付费。

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 . 关于依赖项注入,在编写本文时,尚不支持在Azure Functions中直接使用它,但团队目前正在实现它,这是他们的首要任务之一,因此我们应该尽快使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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