Inbound / outbound maps in Logic Apps!

BizTalk Server offers a great feature that both inbound (receive ports) and outbound maps (send ports) can be executed in dynamic fashion, depending on the message type of the message.  This message type is defined as rootNodeNamespace#rootNodeName.  Below, you can find an example of a receive port configured with several inbound maps.

Maps1

When migrating parts of BizTalk solutions to Azure Logic Apps, it’s really handy to reuse this pattern.  This blog post explains how you can do this.

Configure the Integration Account

In this step, we will prepare the prerequisites to build this functionality.

  • Create an integration account.
  • Upload the required XSLT maps:

Maps2

  • Link your Logic App to the Integration Account, via the Workflow Settings:

Map3

Create the Logic App

It’s time to create a Logic App that uses this functionality.  In this blog, I’ve opted for a request/response pattern, which allows easy testing through Postman.

Map4

  • The first action initializes an Array variable.  The variable contains a list of all expected message types and their corresponding transformation that must be executed.

Map5

  • The second action filter the array.  It selects the object that matches the message type of the incoming message.  The message type is determined through the following expression:
    xpath(xml(body(‘Transform_XML’)), ‘concat(namespace-uri(/*), ”#”, local-name(/*))’)

Map6

  • The last action executes the mapping, of which the name is determined at runtime via this expression:
    body(‘Select_inbound_map’)[0].Transform

Map7

Test the Logic App

Let’s use Postman to test the Logic App and verify that the correct mapping is executed in a dynamic way.

Map8

Conclusion

If you combine the right Logic App actions, you can quite easily give your workflows some dynamic behaviour.  In case you would like to externalize the configuration, that links message types and transforms, you could leverage for example Azure Blob Storage.

ABOUT

MEET THE YOUR AZURE COACH TEAM

Your Azure Coach is specialized in organizing Azure trainings that are infused with real-life experience. All our coaches are active consultants, who are very passionate and who love to share their Azure expertise with you.