Worker Role vs Web Job

atreeon picture atreeon · Sep 13, 2014 · Viewed 18.3k times · Source

From what I understand both run small repeatable tasks in the cloud.

What reasons and in what situations might I want to choose one over the other?

Answer

kwill picture kwill · Sep 14, 2014

Some basic information:

WebJobs are good for lightweight work items that don't need any customization of the environment they run in and don't consume very much resources. They are also really good for tasks that only need to be run periodically, scheduled, or triggered. They are cheap and easy to setup/run. They run in the context of your Website which means you get the same environment that your Website runs in, and any resources they use are resources that your Website can't use.

Worker Roles are good for more resource intensive workloads or if you need to modify the environment where they are running (ie. a particular .NET framework version or something installed into the OS). Worker Roles are more expensive and slightly more difficult to setup and run, but they offer significantly more power.

In general I would start with WebJobs and then move to Worker Roles if you find that your workload requires more than WebJobs can offer.