gpt4 book ai didi

azure - 如何创建计划 webJob 以使用 CRON 表达式运行 exe

转载 作者:行者123 更新时间:2023-12-03 01:07:31 26 4
gpt4 key购买 nike

有一个azure函数(预发布)可以及时执行Windows服务应用程序。现在我必须将其迁移到 Azure Webjob。

如何编写一个 webJob,安排使用 CRON Expression 每 1 分钟执行一次 exe

我是 WebJobs 的新手,我不知道如何去做。我使用的是 Visual studio 2015。在其上安装了 Azure SDK 2.9.6。我经历了this article其中说

simply include a settings.job file at the root of your WebJob zip file. This JSON file should include a schedule property with a CRON expression

但我不知道如何在 Visual Studio 解决方案中执行此操作,因为在我在 Visual Studio 中创建的 WebJob 中,只有“Functions.cs”和“Program.cs”

最佳答案

有几种方法可以做到这一点。

  1. 设置触发的 WebJob 和 schedule it using a chron expression in the settings.job file

  2. 设置连续的 WebJob 并使用 TimerTrigger 对其进行调度。请注意,这涉及添加 Azure WebJob SDK 扩展,而选项 #1 则不需要。

关于azure - 如何创建计划 webJob 以使用 CRON 表达式运行 exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44309860/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com