是否可以将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}");
}
}
首先:为什么要那样?您也可以在现有的App Service上运行Function。查看Azure Functions scale and hosting中的功能的托管选项。
第二:我认为您不能,因为该触发器不适用于WebJobs。网络作业有两种类型:连续和触发。就触发的网络作业而言,它...
仅在手动或按计划触发时启动。
您可以,当然,不用触发器,而转到一个连续的webjobs轮询队列,但是您将丢弃很多东西,Functions运行时会为您抽象一些东西,就像连接到服务总线,检查队列,管理锁以及完成或延迟消息。