Edit

Share via


Monitor and track B2B messages in Consumption workflows for Azure Logic Apps using Azure Monitor

Applies to: Azure Logic Apps (Consumption)

Note

This article applies only to Consumption logic app workflows. For Standard logic app workflows, see:

After you set up B2B communication between trading partners in an integration account, these partners can exchange messages by using protocols such as AS2, X12, and EDIFACT. To confirm that this communication works as expected, 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. By using Azure Monitor logs, you can record and store data about runtime data and events, such as trigger events, run events, and action events in a Log Analytics workspace.

For messages, logging also collects the following information:

  • Message count and status
  • Acknowledgments status
  • Correlations between messages and acknowledgments
  • Detailed error descriptions for failures

Azure Monitor lets you create log queries that help you find and review this information. You can also use this diagnostics data with other Azure services, such as Azure Storage and Azure Event Hubs.

This guide shows how to set up Azure Monitor logging for your integration account. You first install the Logic Apps B2B solution in the Azure portal. This solution provides aggregated information for B2B message events. Then, to enable logging and creating queries, you learn how to set up Azure Monitor logs.

For more information, see:

Note

This article was recently updated to use the term Azure Monitor logs instead of Log Analytics. Log data is still stored in a Log Analytics workspace and is still collected and analyzed by the same Log Analytics service. We are updating the terminology to better reflect the role of logs in Azure Monitor. See Azure Monitor terminology changes for details.

Prerequisites

Install Logic Apps B2B solution

Before Azure Monitor logs can track the B2B messages for your logic app, add the Logic Apps B2B solution to your Log Analytics workspace.

  1. In the Azure portal search box, enter log analytics workspaces, and then select Log Analytics workspaces.

    Screenshot shows the Azure portal search box with Log Analytics workspaces highlighted.

  2. Under Log Analytics workspaces, select your workspace.

    Screenshot shows the Log Analytics workspaces that you can select.

  3. On the Overview page, under Get started with Log Analytics > Configure monitoring solutions, select View solutions.

    Screenshot shows the Overview page for your workspace where you can select View solutions.

  4. On the Overview page, select Add.

  5. After the Marketplace opens, in the search box, enter logic apps b2b, and select Logic Apps B2B.

    Screenshot shows the Marketplace where you can search for and select Logic Apps B2B.

  6. On the solution description pane, select Create.

    Screenshot shows Create selected to add Logic Apps B2B solution.

  7. Review and confirm the Log Analytics workspace where you want to install the solution, and select Create again.

    Screenshot shows the Logic Apps B2B solution page, where you can select subscription and plan, then Create.

    Azure deploys the solution to the Azure resource group that contains your Log Analytics workspace.

  8. Go to your Log Analytics workspace, On the Overview page, on the Get Started tab, select View solutions again to see the installed solution. Select the solution tile to view more message details.

    When the workflow processes B2B messages, the charts update with the message count.

    Screenshot shows the workspace Overview page with the message status chart.

Set up Azure Monitor logs

You can enable Azure Monitor logging directly from your integration account.

  1. In the Azure portal, find and select your integration account.

    Screenshot shows the Integration accounts page where you can select your integration account.

  2. On the integration account sidebar, under Monitoring, select Diagnostic settings. Under the Diagnostic settings table, select Add diagnostic setting.

    Screenshot shows the Diagnostics settings page where you can add a diagnostics setting.

  3. To create the setting, follow these steps:

    1. For Diagnostic setting name, provide a name.

    2. Under Destination details, select Send to Log Analytics workspace.

    3. For Subscription, select the Azure subscription for your Log Analytics workspace.

    4. For Log Analytics Workspace, select the workspace that you want to use.

    5. Under Logs, select Integration Account tracking events, which specifies the event category that you want to record.

    6. When you're done, on the toolbar, select Save.

    For example:

    Screenshot shows the Diagnostic setting page where you can set up Azure Monitor logs to collect diagnostic data.

View message status

After your workflow runs, you can view the status and data about any B2B messages exchanged by partners.

  1. In the Azure portal search box, find and open the resource group for your Log Analytics workspace.

  2. From the resource group, select the Logic Apps B2B solution that you previously installed.

  3. From the solution sidebar, select Summary.

    Screenshot shows the solution Summary page.

    Note

    If the Logic Apps B2B tile doesn't immediately show results after a run, try refreshing the browser or wait for a short time before trying again.

    By default, the Logic Apps B2B tile shows data based on a single day. To change the data scope to a different interval, select the scope control at the top of the page:

    Screenshot shows the control to change the interval.

  4. After the message status dashboard appears, you can view more details for a specific message type, which shows data based on a single day. Select the tile for AS2, X12, or EDIFACT.

    Screenshot shows the status messages.

    A list of messages appears for your chosen tile. For example, here's what an AS2 message list might look like:

    Screenshot shows statuses and details for AS2 messages.

    To learn more about the properties for each message type, see these message property descriptions:

Property descriptions and name formats for AS2, X12, and EDIFACT messages

For each message type, here are the property descriptions and name formats for downloaded message files.

AS2 message property descriptions

Here are the property descriptions for each AS2 message.

Property Description
Sender The guest partner specified in Receive Settings, or the host partner specified in Send Settings for an AS2 agreement
Receiver The host partner specified in Receive Settings, or the guest partner specified in Send Settings for an AS2 agreement
Logic App The logic app where the AS2 actions are set up
Status The AS2 message status
Success = Received or sent a valid AS2 message. No Message Disposition Notification (MDN) is set up.
Success = Received or sent a valid AS2 message. MDN is set up and received, or MDN is sent.
Failed = Received an invalid AS2 message. No MDN is set up.
Pending = Received or sent a valid AS2 message. MDN is set up, and MDN is expected.
ACK The MDN message status
Accepted = Received or sent a positive MDN.
Pending = Waiting to receive or send an MDN.
Rejected = Received or sent a negative MDN.
Not Required = MDN isn't set up in the agreement.
Direction The AS2 message direction
Tracking ID The ID that correlates all the triggers and actions in a logic app
Message ID The AS2 message ID from the AS2 message headers
Timestamp The time when the AS2 action processed the message

X12 message property descriptions

Here are the property descriptions for each X12 message.

Property Description
Sender The guest partner specified in Receive Settings, or the host partner specified in Send Settings for an X12 agreement
Receiver The host partner specified in Receive Settings, or the guest partner specified in Send Settings for an X12 agreement
Logic App The logic app where the X12 actions are set up
Status The X12 message status
Success = Received or sent a valid X12 message. No functional ack is set up.
Success = Received or sent a valid X12 message. Functional ack is set up and received, or a functional ack is sent.
Failed = Received or sent an invalid X12 message.
Pending = Received or sent a valid X12 message. Functional ack is set up, and a functional ack is expected.
ACK Functional Ack (997) status
Accepted = Received or sent a positive functional ack.
Rejected = Received or sent a negative functional ack.
Pending = Expecting a functional ack but not received.
Pending = Generated a functional ack but can't send to partner.
Not Required = Functional ack isn't set up.
Direction The X12 message direction
Tracking ID The ID that correlates all the triggers and actions in a logic app
Msg Type The EDI X12 message type
ICN The Interchange Control Number for the X12 message
TSCN The Transaction Set Control Number for the X12 message
Timestamp The time when the X12 action processed the message

EDIFACT message property descriptions

Here are the property descriptions for each EDIFACT message.

Property Description
Sender The guest partner specified in Receive Settings, or the host partner specified in Send Settings for an EDIFACT agreement
Receiver The host partner specified in Receive Settings, or the guest partner specified in Send Settings for an EDIFACT agreement
Logic App The logic app where the EDIFACT actions are set up
Status The EDIFACT message status
Success = Received or sent a valid EDIFACT message. No functional ack is set up.
Success = Received or sent a valid EDIFACT message. Functional ack is set up and received, or a functional ack is sent.
Failed = Received or sent an invalid EDIFACT message
Pending = Received or sent a valid EDIFACT message. Functional ack is set up, and a functional ack is expected.
ACK Functional Ack (CONTRL) status
Accepted = Received or sent a positive functional ack.
Rejected = Received or sent a negative functional ack.
Pending = Expecting a functional ack but not received.
Pending = Generated a functional ack but can't send to partner.
Not Required = Functional Ack isn't set up.
Direction The EDIFACT message direction
Tracking ID The ID that correlates all the triggers and actions in a logic app
Msg Type The EDIFACT message type
ICN The Interchange Control Number for the EDIFACT message
TSCN The Transaction Set Control Number for the EDIFACT message
Timestamp The time when the EDIFACT action processed the message