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
A Log Analytics workspace. If you don't have a Log Analytics workspace, learn how to create a Log Analytics workspace.
A logic app that's set up with Azure Monitor logging and sends that information to a Log Analytics workspace. Learn how to set up Azure Monitor logs for your logic app.
An integration account that's linked to your logic app. Learn how to link your integration account to your logic app.
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.
In the Azure portal's search box, enter
log analytics workspaces
, and then select Log Analytics workspaces.Under Log Analytics workspaces, select your workspace.
On the Overview pane, under Get started with Log Analytics > Configure monitoring solutions, select View solutions.
On the Overview pane, select Add.
After the Marketplace opens, in the search box, enter
logic apps b2b
, and select Logic Apps B2B.On the solution description pane, select Create.
Review and confirm the Log Analytics workspace where you want to install the solution, and select Create again.
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.
Set up Azure Monitor logs
You can enable Azure Monitor logging directly from your integration account.
In the Azure portal, find and select your integration account.
On your integration account's menu, under Monitoring, select Diagnostic settings. Select Add diagnostic setting.
To create the setting, follow these steps:
Provide a name for the setting.
Select Send to Log Analytics.
For Subscription, select the Azure subscription that's associated with your Log Analytics workspace.
For Log Analytics Workspace, select the workspace that you want to use.
Under log, select the IntegrationAccountTrackingEvents category, which specifies the event category that you want to record.
When you're done, select Save.
For example:
View message status
After your logic app runs, you can view the status and data about those messages in your Log Analytics workspace.
In the Azure portal search box, find and open your Log Analytics workspace.
On your workspace's menu, select Workspace summary > Logic Apps B2B.
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:
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.
A list of messages appears for your chosen tile. For example, here's what an AS2 message list might look like:
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 |