Documentation Index

Fetch the complete documentation index at: https://docs.turbo360.com/llms.txt

Use this file to discover all available pages before exploring further.

Logic App Standard: Hello world

Prev Next

Overview

This sample shows how to track a Logic App Standard workflow in Business Activity Monitoring (BAM) using the pull model. The scenario is a stateful Hello World workflow that receives an HTTP request, parses the JSON body, and returns a transformed response. BAM queries the Application Insights Traces log to surface transaction status, tracked properties, and stage detail in the Turbo360 portal.

Business value

This sample is a minimal, self-contained starting point for anyone setting up pull model tracking against a Logic App Standard workflow for the first time. The query patterns shown here — joining run start, run end, and action end events, promoting tracked properties, and projecting custom columns — are reusable across more complex workflows with only parameter changes.

Sample scenario

The workflow receives an HTTP request with a JSON body, parses it using a Parse JSON action with tracked properties, composes a response object, and returns it via a Response action.

Hello World Logic App Standard workflow diagram

The input message takes the following shape:

{
"name":"Joe",
"surname":"Blogs"
}

The Parse JSON action is configured with tracked properties (FirstName and LastName) that the parent BAM query promotes to the transaction grid.

Business Activity Monitoring queries

This sample uses one parent query and two child queries. The parent query identifies transaction instances. Each child query maps to a transaction stage and is correlated to the parent using the promoted WorkflowRunId field.

Parent query

The parent query joins three event streams from the Application Insights traces table: the workflow run start event, the workflow run end event, and the Parse JSON action end event. This join produces a single row per transaction instance that includes the workflow name, run ID, final status, tracked first and last name properties, and calculated start, end, and duration values.

let input_LogicAppName = "t360-la-standard-pull-bam";
let input_WorkflowName = "HelloWorld";
let input_ActionName = "Parse_JSON";
let workflowStartEvents = traces
| where cloud_RoleName == input_LogicAppName
| where customDimensions.EventName == "WorkflowRunStart"
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).workflowName == input_WorkflowName
| extend runId_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).runId)
| extend workflowName_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).workflowName);
let workflowEndEvents = traces
| where cloud_RoleName == input_LogicAppName
| where customDimensions.EventName == "WorkflowRunEnd"
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).workflowName == input_WorkflowName
| extend runId_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).runId)
| extend final_status_ = tostring(customDimensions.prop__status);
let targetActionEvents = traces
| where cloud_RoleName == input_LogicAppName
| where customDimensions.EventName == "WorkflowActionEnd"
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).workflowName == input_WorkflowName
| where customDimensions.prop__actionName == input_ActionName
| extend runId_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).runId)
| extend FirstName_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).trackedProperties)).FirstName)
| extend LastName_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).trackedProperties)).LastName);
workflowStartEvents
| join kind=inner (workflowEndEvents) on runId_
| join kind=inner (targetActionEvents) on runId_
| extend start = timestamp
| extend end = timestamp1
| extend duration = end - start
| project timestamp, WorkflowName = workflowName_, WorkflowRunId = runId_, final_status_, FirstName_, LastName_, start, end, duration
| order by timestamp desc

Child query 1 — Parse JSON action

This child query retrieves the Parse JSON action end event for a specific run. It uses the WorkflowRunId promoted from the parent query to filter to the correct transaction instance, and extends the FirstName_, LastName_, and status_ fields for display in the stage detail panel.

let input_LogicAppName = "t360-la-standard-pull-bam";
let input_WorkflowName = "HelloWorld";
let input_ActionName = "Parse_JSON";
let input_RunId = {WorkflowRunID};
traces
| where cloud_RoleName == input_LogicAppName
| where customDimensions.EventName == "WorkflowActionEnd"
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).workflowName == input_WorkflowName
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).actionName == input_ActionName
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).runId == input_RunId
| extend FirstName_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).trackedProperties)).FirstName)
| extend LastName_ = tostring(parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).trackedProperties)).LastName)
| extend status_ = tostring(parse_json(tostring(customDimensions.prop__properties)).status)

Child query 2 — Response action

This child query retrieves the Response action end event for a specific run, confirming that the workflow returned a response successfully. Replace input_RunId with the WorkflowRunId value promoted from the parent query.

let input_LogicAppName = "t360-la-standard-pull-bam";
let input_WorkflowName = "HelloWorld";
let input_ActionName = "Response";
let input_RunId = "{WorkflowRunId}";
traces
| where cloud_RoleName == input_LogicAppName
| where customDimensions.EventName == "WorkflowActionEnd"
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).workflowName == input_WorkflowName
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).actionName == input_ActionName
| where parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource)).runId == input_RunId
| extend status_ = tostring(parse_json(tostring(customDimensions.prop__properties)).status)

Sample workflow definition

The following JSON is the complete workflow.json definition for the Hello World Logic App Standard workflow used in this sample. The Parse JSON action includes the trackedProperties block that emits the FirstName and LastName values to Application Insights.

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "contentVersion": "1.0.0.0",
        "actions": {
            "Compose": {
                "type": "Compose",
                "inputs": {
                    "firstname": "@{body('Parse_JSON')?['name']}",
                    "lastname": "@{body('Parse_JSON')?['surname']}"
                },
                "runAfter": {
                    "Parse_JSON": [
                        "SUCCEEDED"
                    ]
                }
            },
            "Response": {
                "type": "Response",
                "kind": "Http",
                "inputs": {
                    "statusCode": 200,
                    "body": "@outputs('Compose')"
                },
                "runAfter": {
                    "Compose": [
                        "SUCCEEDED"
                    ]
                }
            },
            "Parse_JSON": {
                "type": "ParseJson",
                "inputs": {
                    "content": "@triggerBody()",
                    "schema": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "surname": {
                                "type": "string"
                            }
                        }
                    }
                },
                "runAfter": {},
                "trackedProperties": {
                    "FirstName": "@{triggerOutputs()['body']?['name']}",
                    "LastName": "@{triggerOutputs()['body']?['surname']}",
                    "Test": "Test"
                }
            }
        },
        "outputs": {},
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "type": "Request",
                "kind": "Http"
            }
        }
    },
    "kind": "Stateful"
}