Azure Functions vs. Logic Apps

18,017

Solution 1

"Here are few use cases where you can decide to choose between Azure Functions and Azure Logic Apps.

Azure Functions:

  1. Azure Function is code being triggered by an event
  2. Azure Functions can be developed and debugged on local workstation, which is a big plus to increase developer productivity
  3. When dealing with synchronous request/response calls, that execute more complex logic, Azure function is preferred option

Logic Apps:

  1. Logic Apps is a work flow triggered by an event

  2. Logic Apps run only in the cloud, as it has a dependency on Microsoft-managed connectors. It cannot be debug, test or run Logic Apps locally

  3. Logic Apps is better suited for asynchronous integration and fire-and-forget messaging that requires reliable processing.

Azure Functions has sufficient logging and troubleshooting capabilities and you can even build your custom monitoring tools. Functions does not depend on cloud, it can run locally too."

Solution 2

Azure Functions is code being triggered by an event.

Logic Apps is a workflow triggered by an event.

That means that they are also, in fact, complementary. You can, as of sometime yesterday, add a Function as part of a workflow inside a Logic App via the Logic Apps UX.

TL;DR - It's Logic Apps + Functions, not Logic Apps OR Functions.

Solution 3

Logic Apps are used for automating your business process. They make integration with cloud and on premise systems easy with several out of the box connectors. Azure functions on the other hand do something in response to an event, for instance when a message is added to a queue, or a blob is added, process these etc. I guess you can even expose Azure functions as an HTTP API endpoint and integrate into your business process using Logic Apps.

The other obvious difference in my mind is the pricing, Azure functions are charged based on the compute used for the function to execute and the associated memory with the function (https://azure.microsoft.com/en-us/pricing/details/functions/).

Solution 4

Just wanted to add some of my thoughts

Azure Function Apps should be used for

  • High frequency tasks - 1,000,000 executions and 400,000 GB-s of memory is free and then the price is very low. Once you know any coding language functions support you can run millions and millions of executions at very low cost.
  • Very easy to bind with multiple Azure services - while Logic Apps also bind easily to external services if you want to do it from logic apps at high frequency it will cost you a buck or two. Functions also allow for easy input and output bindings to external azure services.
  • Stateful executions - with durable task framework you can run multiple functions, perform fan-in and fan-out and write stateful executions with ease.
  • Programming and Scripting Languages - if you already know programming languages then functions might be easy way to migrate some of your applications to the cloud with minimal changes.

Azure Logic Apps should be used for

  • Low frequency - biggest reason for this is pricing model. Imagine as if single action in logic app is what you pay for as it is separate execution. For example, if you have 1 logic app with 3 steps and you run it every 10 seconds. This will be 18 actions per minute. So, 1080 per hour, 25920 per day. If those 3 actions connect to anything external, i.e. blobs/http, etc. They are connectors and as such simple logic app with 26,000 connector runs per day will net you 100$ a month. Compared to most likely under 1$ for functions.
  • Combining lots of external services/APIs - thanks to 200+ connectors you can easily combine multiple services without a need to learn APIs and such. This is simple TCO calculation, is it better to write X amount of API integrations for price of developer or just use out of the box connectors.
  • Extremely well-designed logging - with visual logging it is very easy to check every single execution step input, outputs, time etc. As if you did log every single line in Azure Functions.
  • Nicely extends other services like Data Factory - some services are extremely well designed for certain tasks, but they are not as good at other tasks. For instance, data factory can't send emails out of the box but in 10 minutes you can call HTTP webhook for Logic App from data factory and start sending emails at ease.

In short as other said. They pay different roles and should be used as such.

In general, Logic apps ❤️ functions.

If you want to check out some info, I encourage you to check

Solution 5

The answer to this question might have changed after the release of Azure Durable Functions. Now the overlap between the two platforms is greater. Both service offerings allow you to build serverless workflows; while Azure Durable Functions are code-based workflows, Logic Apps are visually designed workflows.

Logic Apps are better suited when building integration solutions due to the very extensive list of connectors that should reduce the time-to-market, and when rich visual tools to build and manage are preferred.

Durable Functions are a better fit if you require or prefer to have all the power and flexibility of a robust programming language, or you need more portability, and the available bindings and logging capabilities are sufficient.

A detailed comparison between the two platforms is in this post.

Share:
18,017
Rotem Varon
Author by

Rotem Varon

http://www.binaryradix.com/p/about-me.html

Updated on June 06, 2022

Comments

  • Rotem Varon
    Rotem Varon almost 2 years

    Functions & Logic Apps are two distinct offerings by Microsoft Azure. I wonder what are the use cases that one should favor the new Functions offering over Logic Apps.

  • LastTribunal
    LastTribunal about 7 years
    Both are event driven
  • Sunny Sharma
    Sunny Sharma almost 7 years
    makes a lot of sense over the post marked as answer
  • Muhammad Murad Haider
    Muhammad Murad Haider about 6 years
    even for logic apps, http endpoint can be expose and logic app can then be triggered when a request is sent to that url
  • Next Developer
    Next Developer almost 6 years
    hmm... logic app is series of actions where an action could be a Azure Function?
  • Chris Anderson
    Chris Anderson almost 6 years
    Yep. You can call an Azure Function from a Logic App. It's worth noting that a Logic App can be an action that another Logic App calls, as well. :)