Help! My Logic Apps retries are not firing!

Cloud native applications need to be designed to cope with failure.  Logic Apps meets this expectation through its configurable retry mechanisms that are available on each action.  However, these retries are not firing in every scenario.  Let’s have a look why and how we can work around it.

The problem

Logic Apps retries can be configured in several ways:

  • Default: 4 retries with increasing intervals between 5 and 45 seconds
  • None: no retries at all
  • Exponential interval: exponentially growing interval
  • Fixed interval: specify a retry count and interval

The retries do not kick off on every exception.  Logic Apps only retries transient exceptions, which makes sense.  The HTTP status code is used to determine whether an exception is transient or not.  The documentation states that retries are fired for HTTP codes 408, 429 and 5XX.

The workaround

What if you need to retry in case the HTTP status code is not within the standard range?  Unfortunately, there’s no way to configure the HTTP codes for transient exceptions.  In this case, we need to build it ourselves, with the available actions in our Logic Apps toolbox.  Below you can find an example, where we leveraged the Do-Until action, with a condition based on the return code.  Thx Jef for the screenshot 😉

retry1

Conclusion

It would be easier if we had the ability to override the status codes for transient retries.  However, I understand that this feature gets lower priority, because a simple workaround is available.

I hope this blog helps you to improve the error handling or your integration solutions!
Toon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s