How to choose between Azure Webjobs and Azure Functions

0 votes

I've created some Azure Webjobs that use triggers and I've just learnt about Azure Functions.

From what I understand Azure Functions seem to overlap with Azure Webjobs features and I have some difficulty to understand when to choose between Function and Webjob:

  • Unlike Webjobs, Functions can only be triggered, it hasn't been designed to run continuous process (but you can write code to create a continuous function).

  • You can write Webjobs and Functions using many languages (C#, node.js, python ...) but you can write your function from the Azure portal so it is easier and quicker to develop test and deploy a Function.

  • Webjobs run as background processes in the context of an App Service web app, API app, or mobile app whereas Functions run using a Classic/Dynamic App Service Plan.

  • Regarding the scaling, Functions seems to give more possibilities since you can use a dynamic app service plan and you can scale a single function whereas for a webjob you have to scale the whole web app.

So for sure there is a pricing difference, if you have an existing web app running you can use it to run a webjob without any additional cost but if I don't have an existing web app and I have to write code to trigger a queue should I use a webjob or a Function ?

Is there any other considerations to keep in mind when you need to choose ?

Jul 9, 2018 in Azure by null_void
• 3,220 points
7,136 views

1 answer to this question.

0 votes

There are a couple options here within App Service. I won't touch on Logic Apps or Azure Automation, which also touch this space.

Azure WebJobs

This article is honestly the best explanation, but I'll summarize here.

On Demand WebJobs aka. Scheduled WebJobs aka. Triggered WebJobs

Triggered WebJobs are WebJobs which are run once when a URL is called or when the schedule property is present in schedule.job. Scheduled WebJobs are just WebJobs which have had an Azure Scheduler Job created to call our URL on a schedule, but we also support the schedule property, as mentioned previously.

Summary:

  • + Executable/Script on demand
  • + Scheduled executions
  • - Have to trigger via .scm endpoint
  • - Scaling is manual
  • - VM is always required

Continuous WebJobs (non SDK)

These jobs run forever and we will wake them up when they crash. You need to enable Always On for these to work, which means running them in Basic tier and above.

Summary:

  • + Executable/Script always running
  • - Requires always on - Basic tier and above
  • - VM is always required

Continuous WebJobs with the WebJobs SDK

These aren't anything from a "WebJobs the feature" point of view. Essentially, we have this sweet SDK we wrote targeting WebJobs which lets you execute code based on simple triggers. I'll talk about this more later on.

Summary:

  • + Executable/Script always running
  • + Richer logging/dashboard
  • + Triggers supported along with long running tasks
  • - Requires always on - Basic tier and above
  • - Scaling is manual to set up
  • - Getting started can be a bit tiresome
  • - VM is always required

Azure WebJobs SDK

Azure WebJobs SDK is a completely separate SDK from WebJobs the platform feature. It's designed to be run in a WebJob, but can really be run anywhere. We have customers who run them on worker roles and even on prem or other clouds, though support is only best effort.

The SDK is just about making it easy to run some code in reaction to some event and make binding to services/etc. easy. This is honestly best covered in some docs, but the heart of it is that "event" + "code" nature. We've also done some cool extensiblity work, but that's secondary to the core purpose.

Summary:

  • Most of these are mentioned above
  • + You can extend and run whatever you want. Full control.
  • - HTTP stuff is a little wonky, but it works

Azure Functions

Azure Functions is all about taking that core purpose of the WebJobs SDK, hosting it as a service, and making it easy to get started with other languages. We also introduce the "Serverless" concept here because it made a lot of sense to do so - we know how our SDK scales, so we can do intelligent things for you.

Azure Functions is a very heavily managed experience. We aren't supporting bringing your own host. Currently, we don't support custom extensions but its something we're investigating. We're opinionated about what you can and can't do, but for the things we enable, they are slick, and easy to use and manage.

Most of the "framework" things we've done to improve Functions go through the WebJobs SDK, though. For instance, we'll be uploading a new NuGet for WebJobs which really drastically increases the speed of logging, which has huge perf benefits for WebJobs SDK users. In shipping Functions as "WebJobs SDK as a Service" we've really improved a lot of experience issues.

I'm probably biased since Functions is our latest and greatest, but feel free to shoot more cons for Functions my way.

I'll probably end up publishing a blog which elaborates a bit more, but I tried to keep this as succinct as possible for this forum.

Hope this helps!!

If you need to know more about Azure, then you should join Microsoft Azure certification course today.

Thank you!!

answered Jul 9, 2018 by club_seesharp
• 3,450 points

Related Questions In Azure

0 votes
1 answer

How to choose between Azure App Service and Azure Service Fabric?

Microsoft has created the document with a comparison for ...READ MORE

answered Jun 13, 2018 in Azure by null_void
• 3,220 points
2,331 views
0 votes
1 answer

How to secure network traffic between an Azure website and Azure VM?

If you want to use networking and your own ...READ MORE

answered Apr 5, 2019 in Azure by Prerna
• 1,960 points
714 views
0 votes
1 answer

How to perform dependency injection using Azure WebJobs SDK?

Azure WebJobs SDK now supports instance methods. ...READ MORE

answered Aug 23, 2018 in Azure by club_seesharp
• 3,450 points
2,369 views
0 votes
1 answer

How to serialize and de-serialize a PFX certificate in Azure Key Vault?

Here's a PowerShell script for you. Replace ...READ MORE

answered Sep 24, 2018 in Azure by club_seesharp
• 3,450 points
1,753 views
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

How to query between databases in SQL Azure Database Server?

SQL Azure supports cross database queries: https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/ Hope this ...READ MORE

answered Apr 9, 2019 in Azure by Prerna
• 1,960 points
12,994 views
0 votes
1 answer

How to handle payload formats for both iOS and Android through the Azure Notification Hub?

I think your solution is feasible and ...READ MORE

answered Jul 9, 2019 in Azure by Perry
• 17,100 points

edited Oct 6, 2021 by Sarfaraz 1,817 views
0 votes
2 answers

How can I download a .vhd image to my local machine from azure and upload the same to a different azure account?

From the Windows Azure Portal you can ...READ MORE

answered Aug 20, 2018 in Azure by Priyaj
• 58,020 points
13,980 views
0 votes
2 answers

How can I add database connection string to Azure Functions?

The best way to do this is ...READ MORE

answered Aug 17, 2018 in Azure by Priyaj
• 58,020 points
13,884 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP