Monitoring Azure Logic Apps (Standard) with Azure Monitor Logs (Preview)
Published Feb 20 2023 06:42 AM 6,968 Views
Microsoft

Azure Logic Apps (Standard) offers an integration with Azure Monitor Logs to monitor workflow executions. This article shows you how to configure Azure Logic Apps to send system-generated logs to Azure Monitor Logs by using the Diagnostic Settings configuration.

 

Setting up 

Diagnostic Settings can now be enabled in Azure Logic Apps (Standard) and allows you to emit telemetry to Azure Monitor and other services such as Azure Event Hubs.

To enable Diagnostic Settings:

  • Navigate to an Azure Logic Apps (Standard) instance and then select Diagnostic Settings from the left navigation.

1-DiagnosticSettings.png

  • Next, click on Add diagnostic setting.

2-DiagnosticSettingsAdd.png

  • Enable Workflow Runtime Logs, followed by selecting your Destination.  When using Log Analytics workspace,  select a Subscription and a Log Analytics workspace. If you would prefer to send your logs to an alternative destination select the appropriate checkbox and configure the end point as appropriate.

 

Note: Optionally, you can also select Function Application Logs for some additional telemetry including Host.Startup, Host.Bindings and Host.LanguageWorkerConfig events. To learn more about Azure Function Application Logs, please refer to the following documentation.

3-selectLAWorkspace.png

  • Click Save to enable.

Querying the logs

With our Diagnostics Settings now configured, Azure Logic Apps (Standard) will emit telemetry to Log Analytics.

 

  • WorkflowRunStarted
  • WorkflowRunCompleted
  • WorkflowTriggerStarted
  • WorkflowTriggerEnded
  • WorkflowActionStarted
  • WorkflowActionCompleted
  • WorkflowBatchMessageSend
  • WorkflowBatchMessageRelease

For the completed events we will see an EndTime published which will allow us to determine the duration between the start event and the complete event.

 

4-Workspace.png

 

Including custom properties in your telemetry

Azure Logic Apps includes two capabilities that allow you to inject custom properties into the telemetry that is emitted:

  • Custom Tracking ID: This tracking id can be set on most Azure Logic Apps triggers through the use of an expression. This expression can retrieve data from the message payload that was received or can generate unique values.

5-CustomTrackingID.png

  • Tracked Properties: Can be set on actions throughout your workflow. These properties can leverage logic apps expressions or hard-coded values.

6-TrackedProperties.png

When a workflow contains either Custom Tracking Ids or Tracked Properties, these values will be available in our Log Analytics Workspace.

7-TelemetryCustomProperties.png

 

Sample Queries

Select all events for a specific workflow execution

LogicAppWorkflowRuntime

| where RunId == "08585258189921908774209033046CU00"

Identify exceptions

LogicAppWorkflowRuntime

| where Error != "" 

| sort by StartTime desc

Identify actions that have experienced retries

LogicAppWorkflowRuntime

| where RetryHistory != "" 

| sort by StartTime desc

 

For additional information, please see the following YouTube video or refer to our in-product documentation.

Co-Authors
Version history
Last update:
‎Feb 19 2023 09:01 AM
Updated by: