Azure Logic Apps: long run duration

Edwin Otten
3 min readDec 7, 2022

--

Introduction

Azure Logic Apps is a low-code PaaS solution by Microsoft that features a visual editor to implement business logic. It’s a great way for citizen developers to benefit from Serverless compute in Azure Cloud. It integrates well with other Microsoft technologies and offers tons of Connectors to integrate with 3rd party applications as well.

Screenshot of the visual editor of a Logic App showing steps that get information about a specific route from Bing and sending an e-mail if the travel time exceeds 600 seconds.
Example of an Azure Logic App

The problem

Some (or all) Logic App runs have unexpected long durations. In this example we look at the Run history of a Logic App, which shows failed runs having a duration between 5 and 11 minutes.

Run history of a Logic App that shows 4 failed runs that have durations between 5 and 11 minutes.
Logic App Run history

In this example the runs are failing because the Logic App called an application that was unavailable at that moment, but succeeded runs can also have unexpected long durations.

Troubleshooting

There are 2 possible reasons:

  1. The combined duration of all the actions in the Logic App is too long
    - This often happens if the Logic App makes requests to other systems and those fail. Most actions have a retry policy (an exponential retry policy by default for most operations), those retries can easily add up to multiple minutes.
  2. The Logic App was in waiting state:
    - When inspecting a long Logic App run, it’s not always obvious why it took so long; you may see that the actions only take a couple of seconds but the run duration is over 10 minutes. The likely reason is that you have Concurrency Control enabled on the Logic App Trigger.

Concurrency Control

The Concurrency Control settings on a Logic App Trigger, showing a toggle to enable the concurrency limit and a slider to specify the limit, currently set to 25.
Settings of a Logic App trigger that show Concurrency Control is enabled

Concurrency Control limits the number of instances that can run simultaneously. Any other triggers will start a Logic App run, but the run is in a waiting state until the number of concurrent runs drops below the limit.

Solution

Reduce combined duration of all actions

Most actions have a retry policy (an exponential retry policy by default for most operations), those retries can easily add up to multiple minutes.

Take a look at all the actions in your Logic App that connect to other applications. Go to the Settings of these actions and change the retry policy in such a way that all the actions together stay within the lock duration of

Disable Concurrency Control

The solution is sometimes as simple as disabling Concurrency Control, but this depends on the situation. If the Logic App makes requests to other systems (either via Connectors or direct HTTP calls) it may create a high load on those other systems. Always evaluate if the dependencies your Logic App connects to are able to handle the potential load.

Settings of a Logic App trigger that show Concurrency Control is disabled

--

--

Edwin Otten

I'm a Senior DevOps consultant at Cohesion, specialising in Azure Cloud solutions. I use Medium to share my knowledge with the Azure developer community.