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
- Link your Logic App to the Integration Account, via the Workflow Settings:
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.
- 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.
- 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(/*))’)
- The last action executes the mapping, of which the name is determined at runtime via this expression:body(‘Select_inbound_map’).Transform
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.
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.