Dawid Chróścielski

Node.js & .NET Programmer | Microsoft Azure Developer | Adaptivity Integration Engineer 

https://www.chroscielski.pl

Introduction

Integrate 2021

During the Integrate 2021 conference “Logic Apps” were probably the two most frequently used words in all of the Microsoft presentations. There was a lot of emphasis on that topic. All the modern integration architectures were presenting how to utilize serverless services – I am also working on a project using this and I can clearly see why it is a current trend.

Integration direction – from BizTalk servers to serverless?

The other popular topic was how to migrate from your on-premise BizTalk server. Of course, you could lift-and-shift your current BizTalk server into VM in the cloud, but that will still leave some disadvantages (like lack of scalability). Another option is using the BizTalk Migrator tool, it supports generic scenarios, but might require some additional tweaking regarding supporting specific use cases and performance. Last, but not least is of course a total rewrite of your current integration project to take advantages of the cloud to the fullest.

Migration from BizTalk to serverless in Azure also seems to be utilizing a lot of Logic Apps – which is quite reasonable, as both solutions are visually-oriented. That’s why I find it worth to mention BizTalk in this article as well, as it might be beneficial if you are considering migrating your integrations to cloud. Migration is definitely worth at least considering – I personally have been working a lot with students in the past and everybody was learning about Azure (Logic Apps, Functions) and nobody about BizTalk, so in a couple of years it might be hard to hire new people with that obsolete (then) skillset.

Why am I writing this?

I would like to sum up with a few words on how I feel about Logic Apps at a time of writing (13.06.2021) as a person who deals with systems integration on a daily basis.

Advantages of Logic Apps

Steep learning curve

It is super easy to start with Logic Apps! You build them using a visual designer without the need to dive into code. Even non-programmer may be able to actually create a piece of working software without a huge effort.

Easy to create

Visual designer would be good on its own, but there is much more about it – you have ready-made components waiting for you to use. Those are both built-in components (like conditional blocks, loops, etc.) and (what is more important) “connectors” which allow you to utilize a huge list of 3rd party services (i.e. SendGrid, ServiceNow and many, many more). All you need to do is to provide data required by the component and you can use its features (like creating new time entry in Harvest).

Enterprise Integration Patterns compatibility

Good old Enterprise Integration Patterns can be easily implemented with use of Logic Apps – I think most (if not all) of these patterns are achievable with use of LA.

Easy to investigate

Previously there used to be a run-history available, which was nice, because you could open a particular run and see what happened visually, but it lacked easy correlation with other services. Now it is possible to enable Application Insights logging and that allows us to correlate with other services more easily. So both: easy “debugging” and general observability from a point of view of a whole system is now achievable.

Simple mappings

You can use Liquid Templates and XSLT files to transform the data on the fly – great way if you already have that in your project or for simple mapping scenarios.

Scalability

A great benefit of the cloud solutions like serverless is the possibility to scale without worrying too much. If you use serverless, you simply don’t care (most of the time) about the scalability – it just magically happens for you.

Independent deployments

With serverless it is fairly easily to split your solution into independent services that can be deployed independently, without worrying that you will break the entire system during the release.

Consumption-based pricing

If you pick consumption pricing plan for a Logic App and it runs just couple of times a month, you don’t have to worry about your wallet health, as you will pay only for the time you are really using the compute power of the cloud.

Others

With last updates to the product, there is much more under Logic Apps like VNET integration (for improved security), containing a XSLT files without Integration Account (reduces the costs) or even a possibility to choose whether you want your LA workflow to be stateless (faster, but limited functionality) or statefull (slower, but richer functionality).

Disadvantages:

Code review / code understanding

It’s all fun and games until you need to dig into the code rather than visual designer. Maybe it’s just my thing, but I really don’t find it easy to understand the logic spread across JSON file. I strongly prefer to see the actual mapping code if the logic is complex. However, you can write JavaScript code inside of Logic Apps, invoke a Function App or use Liquid/XSLT transformations – whatever fits you best, but personally I prefer to use Logic Apps for simpler cases because of that reason.

Merge conflicts

Same thing as with code reviews – how do you actually merge a whole workflow reasonably when you will encounter a lot of merge conflicts? Obviously it might be solved with proper project management, but it happens and will be painful if two (or more) work streams need to change the same Logic App and the changes are being made in parallel.

Testability

I am a fan of unit testing, but with Logic Apps you might find it difficult (or actually impossible) to write unit tests for them. You are left with integration tests as the lowest possible level of testing. When I write a new service with a bit more complex logic, I tend to write unit tests in the first place, to isolate the business logic (mappings) I am asked for and to ensure myself that what I write is valid on its own. With unit tests this process is much faster than with integration tests as we can mock pretty much everything.

Summary

Is it worth to use Logic Apps? Of course… it depends ?  But I strongly recommend it for simple scenarios! I use them both in my professional and private projects and there is always some space in which they stand out. Picking up an email attachment, putting it into Blob Storage and then passing blob info to Azure Function which handles the processing? – Logic App is a fit. Logic Apps seem to be great orchestrator for different processes, but if it comes to more complex logic I prefer to put it straight into the code with Azure Functions. However, it is amazingly easy to grab events from other sources thanks to LA connectors and then putting them onto Azure Service Bus to be picked up by Azure Function later on. Tired of SOAP in C#? Maybe you can design a Logic App that uses a connector to SAP and all you need to do is simple REST call from your Azure Function? Possibilities are almost infinite, but I wanted to share couple of examples on how to use Logic Apps properly. See how Adaptivity can help deliver your next App Solution.