Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute an on-demand web job from my ASP.NET website?

Right now I have a web job that is Continuos with "Always On". This webjob listens for queue messages and performs actions. Everything works fine but I have to pay for every minute the web job "listens" to commands, isn't it?

I have seen that you can also run a web job on demand but I haven't found any example code on how to execute an on demand web job.

Background: I am running a web crawler inside a web job that receives the URL that should be crawled from a message queue. I would like to minimize the costs.

How can I execute an on demand web job from my ASP.NET website?

Thanks

like image 293
jimbo Avatar asked Apr 16 '15 18:04

jimbo


1 Answers

Since your site is already running on a Standard Instance and the WebJob is running in the same Web Hosting Plan at your site, you are not paying anything additional as both the WebJob (and its host site) and the site itself are running on the same VMs.

You can enable (or leave) Always On enabled and not incur any additional costs. Turning off Always On will not save you any money and as you are aware, it is required for a Continuous WebJob to run properly.

Hope that helps.

like image 82
Mark Brown Avatar answered Nov 07 '22 11:11

Mark Brown