是否有可能将Azure函数转换为Azure webjob

问题描述 投票:0回答:1

是否可以将Azure函数转换为Azure Webjob?例如,遵循天蓝色功能可以隐秘地执行天蓝色作业吗?

public class Functions
    {
        // This function will get triggered/executed when a new message is written 
        // on an Azure Queue called queue.
        public static void ProcessQueueMessage([ServiceBusTrigger("testsbqueuexxx") ] string message, TextWriter log)
        {
            log.WriteLine($"[WebJobNotificationProcessor-]-{message}");
        }
    }
azure-functions azure-webjobs azure-webjobssdk
1个回答
0
投票

首先:为什么要那样?您也可以在现有的App Service上运行Function。查看Azure Functions scale and hosting中的功能的托管选项。

第二:我认为您不能,因为该触发器不适用于WebJobs。网络作业有两种类型:连续和触发。就触发的网络作业而言,它...

仅在手动或按计划触发时启动。

来源:Run background tasks with WebJobs in Azure App Service

可以,当然,不用触发器,而转到一个连续的webjobs轮询队列,但是您将丢弃很多东西,Functions运行时会为您抽象一些东西,就像连接到服务总线,检查队列,管理锁以及完成或延迟消息。

© www.soinside.com 2019 - 2024. All rights reserved.