If you are using Azure, you have three options,
- Azure Logic Apps (replacing Azure scheduler - read here)
- Azure Functions
- Web Jobs
In Azure Logic Apps, you can build a workflow to migrate the date via "recurrence" trigger.
In Azure Functions you can use Timer Trigger and write your own logic using Azure Service Bus SDK / REST API. You can find more information about Timer Trigger here for C# script, but you can also use JS, F#, etc.
In case you are going with Azure Function, if the scheduled time is every 5 minutes, the function.json
will be coded like below
{
"schedule": "0 */5 * * * *",
"name": "myTimer",
"type": "timerTrigger",
"direction": "in"
}
The code for the function will be something like below
public static void Run(TimerInfo myTimer, ILogger log)
{
const string ServiceBusConnectionString = "<your_connection_string>";
const string QueueName = "<your_queue_name>";
static IQueueClient queueClient
if (myTimer.IsPastDue)
{
log.LogInformation("Timer is running late!");
}
queueClient = new QueueClient(ServiceBusConnectionString, QueueName);
// Your logic to read to write message
}
I am using the .NET SDK for Azure Service Bus, you can find the reference here. If you are new to Azure Functions, the C# scripting function works slightly in a different way. The approach of referencing a dll is different. You can find it here.
When it comes to Azure Web Jobs, its running as a part of Azure Web apps. For Azure Web Job, you can write a webjob using a console application template as well. You can use the same Azure Service Bus SDK mentioned above for the development of the Web Job as well. Find the documentatio of Azure Web Jobs here.