1
votes

There is a azure function(pre-release) which timely executes a windows service application. Now I have to migrate it to a Azure webjob.

How can I write a webJob which schedules to execute the exe every 1 min using a CRON Expression

I am a complete newbie for WebJobs and I have no idea on how to do it. I'm using Visual studio 2015. Installed the Azure SDK 2.9.6 on top of that. I went through this article which says to

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

But I coudn't figure out how I could do it in my Visual Studio solution, since in the WebJob I have created in Visual Studio, only has 'Functions.cs' and 'Program.cs'

2

2 Answers

2
votes

There's a few ways to do it.

  1. Set up a triggered WebJob and schedule it using a chron expression in the settings.job file.

  2. Set up a continuous WebJob and schedule it using a TimerTrigger. Note that this involves adding Azure WebJob SDK Extensions, where option #1 does not.

1
votes

Rob Reagan's answer was informative. I found this post with the visual studio example