Azure Functions vs Azure Logic App | Difference between Azure Functions and Azure Logic App

{tocify} $title={Table of Contents}

Introduction

Azure functions and Azure Logic apps are both part of serverless offering from Microsoft and also they have variants available with some additional capabilities to cater specific requirements like Vnet integration, security etc.

Azure function is offering to primarily help with a scenario where there is a need to have small piece of code solving specific problem, which can be hosted on cloud and can be accessed wherever required. (Loosely coupled function - Function as a service).

Azure logic apps is offering to primarily automate the processes which involves talking to various applications, systems or services. And with this intent there are lot of connectors made available which can be configured using visual designer - making it no/low code and easy to use.

Although both are targeted to serve different purposes, there is a bit of overlap as to what all can be done.

Using Azure function you can certainly do almost everything which you can do using Azure logic app as you have control as to what you can code (you should be good with coding 😉) but it comes at a price of time and complexities etc. 

But in my humble opinion, things which can be done easily shouldn't be made complex unnecessarily.

Let's see comparison of few features of both.



Azure Function vs Logic App


Features

Azure Functions

Azure Logic App

What is

Azure Functions is a code being triggered by an event.

Logic Apps is a  workflow triggered by an event.

Way to develop

Code first approach, you can select from supported languages and start the development.

Designer first approach, where you add actions and configure them using visual designer/editor.

How to develop

Development can be done using Azure Portal, Visual Studio, Visual code or any supporting IDE

Development can be done using Azure Portal and Visual Studio, Visual code

What Languages supported

C#, F#, Java, JavaScript, Python, TypeScript, PowerShell etc.

Only JSON that too in code view

Defining Workflow

Workflow in Azure Function can be defined using Durable function. One Orchestrator function that has the workflow defined with several activity functions.

Workflow in Azure Logic App is designed by adding steps(actions) and with help of connectors.

Deployment methods

  •  Visual Studio Code publish
  •  Visual Studio publish
  •  Core Tools publish
  •  Deployment Center (CI/CD)
  •  Container deployments
  •  Azure Pipelines
  •  GitHub Actions
  • Deployment slots


After creating an Azure Resource Manager template of logic app, you can deploy your template in following ways:

  • Azure portal
  • Visual Studio
  • Azure PowerShell
  • Azure CLI
  • Azure Resource Manager REST API
  • Azure DevOps


Deployment Models(Hosting Plans)


  • Consumption
  • Premium 
  • Dedicated


  • Standard (Single Tenant)
  • Consumption (MultiTenant)
  • Consumption(ISE)

How to Secure

Using following Azure Functions can be secured


  • Function Keys
  • Active Directory Authentication
  • APIM
  • Deploying in ASE(App service Environment)

Using following Azure Logic apps can be secured


  • RBAC
  • Active Directory Authentication
  • APIM
  • Deploying in ISE(Integrated service Environment)
  • IP Address restrictions

Networking options

There is no provision yet to connect Azure function in consumption plan to connect on premise resources.

When using Azure Functions within an App Service Plan, it offers support for many networking options like Hybrid Connections, VNET Integration and can be part of App Service Environment.

With the help of On Premise data gateway, logic App in consumption can connect with on premise resources.

In the case of a logic app in ISE, as ISE is part of a virtual network, it does allow on premise resource access.

Cost of use

The Cost of Azure Functions in consumption plan is based on resource consumption and executions per second.


Whereas when opted for App service plan costing is not based on execution rather on resource consumption.

The Cost of Azure logic apps in consumption plan is based on number of times trigger, action or connector is executed and 0.12 gb/month for data retention.


Also there is a cost associated with the Integration account, if it is used.


If opted for ISE, it is fixed and also includes one Integration Account.

Trigger

Supports only one trigger.


It can be triggered with configured triggers like HTTPTrigger, TimerTrigger, QueueTrigger etc.

Supports more than one trigger but not through designer instead through code view.

It can be triggered with API as connectors, manually, time based etc.

Can be used Interchangeably

Can be used in place of Logic App in most of the cases.

In Limited scenario logic apps can be used in place of Azure Function.

Ease of use

Bit complex, as coding is involved.

Easy, as no/low code involved and majorly configuration.

Monitoring Options

You can use the Azure Monitor tab to see the execution history, also Application Insights can be used.

With the help of Azure portal where the Run history, Trigger history is captured along with details on each action's input and output.


Also Log Analytics can be leveraged.

Connectivity options

No connectors and connectivity is limited through input and output bindings.

It is the strength of Logic app, more than 200+ out of box connectors available and more in the pipeline.

State 

Azure functions are stateless in nature.


However Azure Durable functions are stateful.

Azure logic Apps are stateful in nature however with Logic App standard you have the option to create a stateful or stateless workflow.

Exception Handling

Try-catch implementation can be done wherever required.

Can be implemented with the use of features like Retry policy, Run After Property and Scopes (Try/Catch).

Management

Can be managed through Azure Portal, REST API and Visual Studio

Can be managed through Azure portal, REST API, PowerShell and also through Visual Studio.

Predefined Templates

Around 21 templates are available to choose from.

Lot of templates are made available based on most used scenarios.

APIM integration

Can be imported as an api in APIM

Can be imported as an api in APIM

Nesting option

A function can be called from another function.

A logic app can be called from another logic app.

Proxy option

Out of box Proxy feature is available

No such feature

When to use

Use cases can be anything which can executed as separate processes, examples 


  • File processing
  • Sending emails
  • For creating backup 
  • Report generation on schedule
  • Order processing
  • Sending scheduled Notifications
  • Sending scheduled messages
  • For scheduled database cleanup
  • IoT data processing 

 and many more.


Use cases can be anything where automation of process is required, examples 


  • Integrating various applications in an Enterprise
  • Enabling B2B communication (EDI,AS2)
  • Call Azure Automation run books
  • Analyzing Twitter sentiments using Logic Apps
  • Automating business Process


 and many more.

Where can it be executed

Primarily on Azure and also locally, in containers or any self managed servers.

Primarily in Azure, however with Logic app standard- offering it can be executed locally, in containers using Azure Arc enable Logic Apps and also in App Service environment.



Summary


We saw the comparison of features of both Azure function and Azure logic app, which helps understanding the capabilities.

However we do get keeping this question which one is better and which one to go with.

As far as I understand, this question arises based out of two scenarios
1. Cost
2. Availability of coding skill

But it shouldn't biased based on only two above, rather we should focus of utilizing out of box features, simplicity of solution, ease of management of solution etc.


Beauty of IT is that for any scenario/issue there are multiple ways to solve/achieve, but that also leads to confusion.




Learn More about Logic App

Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post