运行 Azure 上的周期性任务

Running a recurring task on Azure

我有一个 SQL Azure 数据库,我想 运行 每天晚上执行一些通宵任务。

第一个任务是数据更新,运行在存储过程中。

第二个任务需要 运行 C# 代码来执行许多任务,包括调用数据库、处理数据和发送电子邮件。

我倾向于使用 Azure WebJobs 来完成这些任务中的每一个,但我认为可能有更好的方法我错过了。

调度程序不应该在 Azure 上执行此操作吗? https://azure.microsoft.com/en-us/services/scheduler/

Azure 自动化是许多人使用的另一个选项:https://azure.microsoft.com/en-us/blog/azure-automation-your-sql-agent-in-the-cloud/

虽然该服务基于 PowerShell,但可以上传和引用 C# dll。

Azure WebJob 可能是一个不错的选择。在安排 WebJob 方面,首选方法是使用 here.

中描述的 CRON 方法

自从 2015 年提出这个问题以来,情况发生了很大变化。

如果您今天正在看这个,那么 Azure Logic App would be the likely answer. Logic Apps are replaced deprecated Azure Scheduler

具体取决于您的任务需要什么,您可以根据需要对其进行调整 运行 natively within the Logic App, port it to one or more of the connectors or indeed connect back to on-premise