How can I run Azure WebJob locally

I want to create a continuous website, but first I want to try to run it locally first for debugging. I am using Visual Studio 2015 and my azure storage emulator is working (I can run the sample for azure webjobs in visual studio). When I run this, it does not work on the new line JobHost ().
Exception: value cannot be null. Parameter Name: Method

static void Main() { var host = new JobHost(); host.CallAsync(typeof(Functions).GetMethod("GetNextJob")); // The following code ensures that the WebJob will be running continuously host.RunAndBlock(); } [NoAutomaticTriggerAttribute] public static async Task GetNextJob() { while(true) { try { var log = new Logger(); log.WriteInfo("Getting next job to be run", 0, 0, "Brain"); //Console.WriteLine("Getting new Job and putting to que"); } catch(Exception ex) { Console.WriteLine(ex.Message); } await Task.Delay(TimeSpan.FromSeconds(5)); } } 

Is it possible to run local work tasks on an ongoing basis?

+5
source share
1 answer

Laser web jobs are usually just console applications. You can run it locally, as if you were debugging, testing, and running any other console application. I recommend getting the Azure WebJobs SDK and running the Create .NET WebJob tutorial in the Azure App Service .

+12
source

Source: https://habr.com/ru/post/1233981/


All Articles