I need some help with the Azure webjobs as even after reading many articles it is unclear how I can get a 'simple' Azure webjob up and running. I'm trying to achieve the following:
- The job should be run on a schedule (e.g. every 4 hours)
- The webjob should run without the use of queues (e.g. completely stand alone)
- The web application shouldn't have to be 'Always On'
- The webjob should be able run a long running task (e.g. 3 hours)
- If possible it should be possible run in the free tier
Below is a short code of example of what I'm experimenting with.
static void Main(string[] args)
{
var host = new JobHost();
host.Call(typeof(Program).GetMethod("RunTask"));
}
[NoAutomaticTrigger]
public static void RunTask(TextWriter log)
{
log.WriteLine($"Executed: {DateTime.Now.ToLongTimeString()}");
}
Does anybody have any experience with this?