Logic App B2B Solution

Posted: February 9, 2024  |  Categories: Azure

Today, I am going to write about using the Logic App B2B Solution to monitor AS2/EDIFACT exchanges. Microsoft says

After you set up B2B communication between trading partners in your integration account, those partners can exchange messages by using protocols such as AS2, X12, and EDIFACT. To check that this communication works the way you expect, you can set up Azure Monitor logs for your integration account. Azure Monitor helps you monitor your cloud and on-premises environments so that you can more easily maintain their availability and performance.

Monitor B2B messages with Azure Monitor – Azure Logic Apps | Microsoft Learn

Our Use Case

Firstly, let me explain why we need this solution. One of our customers EDIFACT invoices began to fail in a Decode EDIFACT message Logic App action with this output.

    "body": {
        "groupControlNumbers": [],
        "goodMessages": [],
        "badMessages": [
            {
                "decimalPointIndicator": 0,
                "repetitionSeparator": 0,
                "escapeCharacter": 0,
                "technicalAckExpected": false,
                "functionalAckExpected": false,
                "exception": "Error: 1 (Miscellaneous error)\r\n\t26: Duplicate interchange detected",
                "componentSeparator": 0,
                "dataElementSeparator": 0,
                "payload": "redacted",
                "replacementCharacter": 0,
                "segmentTerminator": 0,
                "agreementName": "BidfoodAU-Partner-EDI",
                "guestPartnerName": "B2BE",
                "hostPartnerName": "BidfoodAU",
                "ReceiverIdentifier": "9429000000XXX",
                "receiverQualifier": "14",
                "SenderIdentifier": "9377778097XXX",
                "senderQualifier": "ZZ"
            }
        ],
        "generatedAcks": [],
        "receivedAcks": [],
        "agreementName": "BidfoodAU-Partner-EDI",
        "guestPartnerName": "Partner",
        "hostPartnerName": "BidfoodAU",
        "ReceiverIdentifier": "9429000000XXX",
        "receiverQualifier": "14",
        "SenderIdentifier": "937777809XXX",
        "senderQualifier": "ZZ"
    }

Furthermore, the exception is quite specific, an invoice has a duplicate interchange control number (ICN). Some other message also contains the same ICN and for EDIFACT exchanges this should be unique. The ICN number in bold below, is in the UNH 1 segment of an EDIFACT message.

UNA:+.? ‘
UNB+UNOC:3+9377778097633:ZZ+9429000000024:14+240209:2150+4308++++1′
UNH+4308+INVOIC:D:01B:UN:EAN010′

To get back to the point, on contacting the customer asking them to stop sending duplicate ICNs, they asked what the duplicate EDIFACT message was. I found this remarkably difficult to find the duplicate message. Thus, I write about it here.

Unsuccessful solutions

We use the Logic Apps Management solution to monitor our Logic workflows. Thus, my first attempt adds a tracking property to the Logic app workflow to capture the ICN. in this way we good query for duplicate ICNs.

However, the iCN is not in the view tab on the Logic App management even though the other properties are present.

Finally, after trying to solve this issue I did not continue this approach.

Logic App B2B Solution

In contrast our exchange does not use this solution. I began to examine this, remembering that this solution collects the ICN number for each EDIFACT message. Implementing this using the Microsoft guidance linked above was easy. Our reason for not using this before is because it collects more data in log analytics, and we saw no use for it until now. Checking the current usage of our Log analytics workspace suggests we are well below our daily allowance of 2 Gb. This adding the Logic App B2B solution should have no cost consequences.

Subsequently, after implementing this solution we were able to see the ICN’s and find the duplicate EDIFACT message.

Conclusion

I have shown that the Logic App B2B Solution is a useful way to monitor EDIFACT solutions. I recommend this to anyone else who works with EDIFACT messages. Finally, I leave with you with a higher-level picture of the solution.

turbo360

Back to Top