'Running a recurring task on Azure
I have a SQL Azure database and I want to run a couple of overnight tasks, every night.
The First task will be a data update, running in a Stored procedure.
The Second task will need to run C# code that will do a number of tasks, including making calls to the database, processing data and sending emails.
I'm leaning towards using Azure WebJobs for each of these tasks, but I though there might be a better way that I have missed.
Solution 1:[1]
An Azure WebJob would likely be a good choice for this. In term of scheduling the WebJob, the preferred way is to use the CRON approach described here.
Solution 2:[2]
Azure Automation is another options that many folks have used: https://azure.microsoft.com/en-us/blog/azure-automation-your-sql-agent-in-the-cloud/
Although the service is based on PowerShell, one can upload and reference C# dlls.
Solution 3:[3]
Isn't Scheduler supposed to do this on Azure? https://azure.microsoft.com/en-us/services/scheduler/
Solution 4:[4]
Since this question was asked in 2015 much has changed.
If you were looking at this today then Azure Logic App would be the likely answer. Logic Apps are replaced deprecated Azure Scheduler
Depending on exactly what your tasks entail you could adapt it to run natively within the Logic App, port it to one or more of the connectors or indeed connect back to on-premise if that is required.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | David Ebbo |
| Solution 2 | Joseph Idziorek |
| Solution 3 | NicoJuicy |
| Solution 4 | dove |
