Building B2B Azure Logic Apps for Sending and Receiving the EDI AS2 Messages

Alagappan Thiyagarajan
6 min readApr 3, 2021

--

For business-to-business (B2B) solutions and seamless communication between organizations, you can build automated scalable enterprise integration workflows by using the Enterprise Integration Pack (EIP) with Azure Logic Apps.

The EIP transforms different formats into a format that your organizations’ systems can process and supports industry-standard protocols, including AS2, X12 and EDIFACT

The EIP supports these enterprise Integration Connectors and these industry standards:

· Electronic Data Interchange (EDI)

· Enterprise Application Integration (EAI)

We can start building B2B logic app workflows with the EIP. Here are the high-level steps to get started building B2B logic apps:

An Integration Account, which is a separate Azure resource that provides a secure, scalable, and manageable container for the integration artifacts that you define and use with your logic app workflows.

A Trading Partners are entities that participate in B2B transactions and exchange messages with each other

A Trading Partners Agreement helps organizations and businesses communicate seamlessly with each other by defining the specific industry-standard protocol to use when exchanging business-to-business (B2B) messages.

Logic Apps simplifies how you design and build scalable solutions for app integration, data integration, system integration, enterprise application integration (EAI), and business-to-business (B2B) communication, whether in the cloud, on premises, or both

STEP1:

An Azure subscription. If you don’t have an Azure subscription, sign up for a Azure Account

STEP2:

Sign in to the Azure Portal with your Azure account credentials. On the main Azure menu, select Create a resource. In the search box, enter “integration account” as your filter, and select Integration Account. Provide this information about your integration account. When you’re finished, select Create. After deployment completes, Azure opens your integration account.

Note: You will be creating a new Integration Account: B2BIntegration for sending and receiving AS2 Files

STEP3:

On the main Azure menu, select All services. In the search box, enter “integration”, and select Integration accounts. Under Integration Accounts, select the integration account where you want to add your partners. Choose the Partners tile. Under Partners, choose Add. Under Add Partner, provide the partner’s details as described by the table below. When you’re done, choose OK.

Note: You will be creating 2 Partners where one will be with Customer AS2 ID Details and other will be the Partner AS2 ID Details. Here you can also add the EDI ID Details of the Partner and Customer in order to exchange the files in Standard EDI Format

STEP4:

On the main Azure menu, select All services. In the search box, enter “integration” as your filter. From the results, select this resource: Integration accounts. Under Integration accounts, select the integration account where you want to create the agreement. In the right-hand pane, under Components, choose the Agreements tile. Under Agreements, choose Add. In the Add pane, provide information about your agreement, when you’re done creating your agreement, on the Add page, choose OK, and return to your integration account. The Agreements list now shows your new agreement.

Note: We will be associating the Customer and Partner AS2 Details under the Agreement. We will configure the Send and Receive Settings as per the requirements gathered. Here we will be enabling Encryption, Signing, MDN, Adding Certificates, Algorithm Selection, Compression etc.

STEP5:

In the Azure portal search box, enter Logic Apps, and select Logic Apps. On the Logic Apps page, select Add. On the Logic App pane, provide basic details and settings for your logic app. Create a new resource group for the purposes of this example logic app. When you're ready, select Review + Create. Confirm the details that you provided and select Create. After Azure successfully deploys your app, select Go to resource. Or, you can find and select your logic app by typing the name in the search box.

Note: We will be creating be creating 2 Logic Apps. One will be ReceiveAS2 App and other will be SendAS2 App

STEP6:

On your logic app’s menu, under Settings, select Workflow settings. Under Integration account, open the Select an Integration account list. Select the integration account to link to your logic app.

Note: We will be linking both SendAS2 App and ReceiveAS2 App to our Integration Account: B2BIntegration

STEP7:

We will design the SendAS2 app by selecting Recurrence Step like below. Add a HTTP Step where we will be giving our Partner AS2 details like URL. Add the Headers with AS2 Details, Message ID which we will be generated automatically for our reference and keep the Body as Sample Message.

STEP8:

Execute Run trigger which will send a file to Partner system. You can get the Headers generated and can see the status code:200 if it is successful. Verify the connection with Partner about the file received

STEP9:

We will design the ReceiveAS2 app by selecting when a HTTP request is received Step like below which will generate the POST URL for Partner. Add a Decode AS2 Step where we will be selecting Body and Headers. Add a MDNType Step to check the MDN Mode as Sync or ASync. Add a action under True branch with the Status code: 200 like below and leave the False Branch with the same Status code: 200 for checking the processing

STEP10:

You can request Partner to send a file to your App and track the files under your ReceiveAS2 App.

This is how the Integration between Microsoft Azure and any other B2B Application can be done for sending and receiving the files via AS2 Setup. We can add more security in our setup by adding the Compression, Signature and Encryption etc.

Keep Learning :)

--

--

No responses yet