Set up Azure Monitor logs and collect diagnostics data for B2B messages in Azure Logic Apps

Applies to: Azure Logic Apps (Consumption)

Note

This article applies only to Consumption logic apps. For information about monitoring Standard logic apps, review Enable or open Application Insights after deployment for Standard logic apps.

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. 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 information such as:

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

Azure Monitor lets you create log queries to 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.

To set up logging for your integration account, 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 for this information, set up Azure Monitor logs.

This article shows how to enable Azure Monitor logging for your integration account.

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's search box, enter log analytics workspaces, and then select Log Analytics workspaces.

    Select "Log Analytics workspaces"

  2. Under Log Analytics workspaces, select your workspace.

    Select your Log Analytics workspace

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

    On Overview pane, select "View solutions"

  4. On the Overview pane, select Add.

    On overview pane, add new solution

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

    From Marketplace, select "Logic Apps Management"

  6. On the solution description pane, select Create.

    Select "Create" 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.

    Select "Create" for "Logic Apps B2B"

    After Azure deploys the solution to the Azure resource group that contains your Log Analytics workspace, the solution appears on your workspace's summary pane. When B2B messages are processed, the message count on this pane is updated.

    Workspace summary pane

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.

    Find and select your integration account

  2. On your integration account's menu, under Monitoring, select Diagnostic settings. Select Add diagnostic setting.

    Under "Monitoring", select "Diagnostics settings"

  3. To create the setting, follow these steps:

    1. Provide a name for the setting.

    2. Select Send to Log Analytics.

    3. For Subscription, select the Azure subscription that's associated with your Log Analytics workspace.

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

    5. Under log, select the IntegrationAccountTrackingEvents category, which specifies the event category that you want to record.

    6. When you're done, select Save.

    For example:

    Set up Azure Monitor logs to collect diagnostic data

View message status

After your logic app runs, you can view the status and data about those messages in your Log Analytics workspace.

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

  2. On your workspace's menu, select Workspace summary > Logic Apps B2B.

    Workspace summary pane

    Note

    If the Logic Apps B2B tile doesn't immediately show results after a run, try selecting Refresh 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:

    Change interval

  3. 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.

    View statuses for messages

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

    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 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 is not 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 is not 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 is not 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

Next steps