{ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "resourceName": { "type": "string", "defaultValue": "LogicAppOverview-Template", "metadata": { "description": "The unique name for this workbook template instance" } } }, "resources": [ { "name": "[parameters('resourceName')]", "type": "microsoft.insights/workbooktemplates", "location": "[resourceGroup().location]", "apiVersion": "2019-10-17-preview", "dependsOn": [], "properties": { "galleries": [ { "name": "Logic App Overview Workbook Template", "category": "Deployed Templates", "order": 100, "type": "workbook", "resourceType": "Azure Monitor" } ], "templateData": { "version": "Notebook/1.0", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "54b50e2a-ec77-46d3-8a2e-05f1a6d83ea1", "version": "KqlParameterItem/1.0", "name": "Subscription", "type": 6, "isRequired": true, "isGlobal": true, "query": "Resources\r\n| where type =~ 'microsoft.insights/components'\r\n| summarize Count = count() by subscriptionId\r\n|order by Count desc\r\n| project value = subscriptionId, label = subscriptionId, selected = Count > 1", "crossComponentResources": [ "value::all" ], "typeSettings": { "additionalResourceOptions": [], "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "value": "" }, { "id": "51b09579-78ed-42fd-8f11-ab5634b01a8c", "version": "KqlParameterItem/1.0", "name": "ApplicationInsights", "type": 5, "isRequired": true, "isGlobal": true, "query": "where type in~('microsoft.insights/components')\r\n|order by name asc\r\n| project value = id, label = name\r\n\r\n//row_number()\\r\\n| project value = resourceGroup, label = resourceGroup, selected = Rank == 1", "crossComponentResources": [ "{Subscription}" ], "typeSettings": { "resourceTypeFilter": { "microsoft.insights/components": true }, "additionalResourceOptions": [], "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "value": "" }, { "id": "441bf375-dd40-4b8d-98ed-64778257264c", "version": "KqlParameterItem/1.0", "name": "LogicApp", "label": "Logic App", "type": 5, "isRequired": true, "query": "where type in~('microsoft.web/sites')\r\n|where kind contains \"workflowapp\"\r\n|order by name asc\r\n| project value = id, label = name", "crossComponentResources": [ "{Subscription}" ], "typeSettings": { "additionalResourceOptions": [], "showDefault": false }, "timeContext": { "durationMs": 0 }, "timeContextFromParameter": "TimeRange", "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", "value": "" }, { "id": "4a173d9f-44b6-4cdf-88a3-8c029a764a66", "version": "KqlParameterItem/1.0", "name": "TimeRange", "type": 4, "isRequired": true, "typeSettings": { "selectableValues": [ { "durationMs": 300000 }, { "durationMs": 900000 }, { "durationMs": 1800000 }, { "durationMs": 3600000 }, { "durationMs": 14400000 }, { "durationMs": 43200000 }, { "durationMs": 86400000 }, { "durationMs": 172800000 }, { "durationMs": 259200000 }, { "durationMs": 604800000 }, { "durationMs": 1209600000 }, { "durationMs": 2419200000 }, { "durationMs": 2592000000 }, { "durationMs": 5184000000 }, { "durationMs": 7776000000 } ] }, "timeContext": { "durationMs": 86400000 }, "value": { "durationMs": 604800000 } } ], "style": "above", "queryType": 0, "resourceType": "microsoft.operationalinsights/workspaces" }, "name": "parameters - 4" }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{ApplicationInsights}" ], "parameters": [ { "id": "bd56bb14-d65b-43f5-8c54-f2f34657c19c", "version": "KqlParameterItem/1.0", "name": "WorkflowName", "type": 2, "isRequired": true, "isGlobal": true, "query": "traces\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\n|extend category = tostring(customDimensions[\"Category\"])\r\n|where category == \"Workflow.Operations.Runs\"\r\n|distinct operation_Name", "crossComponentResources": [ "{ApplicationInsights}" ], "typeSettings": { "additionalResourceOptions": [], "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "microsoft.insights/components", "value": "" }, { "id": "328ac264-297d-4c07-bb85-2fe85b553d93", "version": "KqlParameterItem/1.0", "name": "Status", "type": 2, "multiSelect": true, "quote": "", "delimiter": ",", "typeSettings": { "additionalResourceOptions": [], "showDefault": false }, "jsonData": "[[\"Succeeded\", \"Failed\", \"Running\"]", "timeContext": { "durationMs": 86400000 }, "value": [ "Running", "Succeeded", "Failed" ] }, { "id": "36a91a83-bf6b-408f-a0d8-5f96483c749a", "version": "KqlParameterItem/1.0", "name": "ClientTrackingId", "type": 1, "timeContext": { "durationMs": 86400000 } } ], "style": "pills", "queryType": 0, "resourceType": "microsoft.insights/components" }, "name": "parameters - 4" }, { "type": 1, "content": { "json": "This Dashboard uses Application Insight V2 integration for Logic Apps and please make sure the host.json file for this app has the following settings.\r\n```\r\n{\r\n \"version\": \"2.0\",\r\n \"extensionBundle\": {\r\n \"id\": \"Microsoft.Azure.Functions.ExtensionBundle.Workflows\",\r\n \"version\": \" [1, 2.00) \"\r\n },\r\n \"extensions\": {\r\n \"workflow\": {\r\n \"Settings\": {\r\n \"Runtime.ApplicationInsightTelemetryVersion\": \"v2\"\r\n }\r\n }\r\n }\r\n} \r\n```" }, "conditionalVisibility": { "parameterName": "WorkflowName", "comparison": "isEqualTo" }, "name": "text - 1" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let runs=traces\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\n|where operation_Name =~ '{WorkflowName}'\r\n|extend category = tostring(customDimensions[\"Category\"])\r\n|where category == \"Workflow.Operations.Runs\"\r\n|extend eventName=tostring(customDimensions[\"EventName\"]);\r\nlet triggers=requests\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\n|where operation_Name =~ '{WorkflowName}'\r\n|extend category = tostring(customDimensions[\"Category\"])\r\n|where category == \"Workflow.Operations.Triggers\";\r\nruns\r\n|where eventName == \"WorkflowRunStart\"\r\n|join kind=leftouter (runs\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\n|where operation_Name =~ '{WorkflowName}'\r\n|where eventName == \"WorkflowRunEnd\") on operation_Id\r\n|join kind=leftouter (triggers | project TriggerName=name, operation_Id) on operation_Id\r\n|extend status=iif(isempty(eventName1), \"Running\", customDimensions1[\"status\"])\r\n|project RunId=operation_Id, status=replace_string(status, @\"\"\"\", \"\"), startTime=timestamp, durationInMilliseconds=customDimensions1[\"prop__durationInMilliseconds\"], VersionId=tostring(customDimensions[\"prop__flowSequenceId\"]), clientTrackingId=parse_json(tostring(customDimensions[\"correlation\"]))[\"clientTrackingId\"], View=\"View\", TriggerName\r\n|where isempty(\"{Status}\") or status in (split('{Status}', ','))\r\n|where isempty(\"{ClientTrackingId}\") or clientTrackingId == '{ClientTrackingId}'\r\n|order by startTime desc\r\n\r\n\r\n//|project RunId=operation_Id, status, clientTrackingId=tostring(customDimensions1[\"prop__clientTrackingId\"]), //version = tostring(customDimensions1[\"prop__flowSequenceId\"]), startTime=timestamp,endTime=timestamp1\r\n\r\n\r\n\r\n", "size": 1, "title": "Completed Run Details for {WorkflowName}", "timeContextFromParameter": "TimeRange", "exportedParameters": [ { "fieldName": "RunId", "parameterName": "RunId", "parameterType": 1 }, { "fieldName": "TriggerName", "parameterName": "TriggerName", "parameterType": 1 }, { "fieldName": "status", "parameterName": "status", "parameterType": 1 }, { "fieldName": "startTime", "parameterName": "startTime", "parameterType": 1 }, { "fieldName": "endTime", "parameterName": "endTime", "parameterType": 1 }, { "fieldName": "clientTrackingId", "parameterName": "clientTrackingId", "parameterType": 1 }, { "fieldName": "VersionId", "parameterName": "versionId", "parameterType": 1 } ], "queryType": 0, "resourceType": "microsoft.insights/components", "crossComponentResources": [ "{ApplicationInsights}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "status", "formatter": 18, "formatOptions": { "thresholdsOptions": "icons", "thresholdsGrid": [ { "operator": "==", "thresholdValue": "Succeeded", "representation": "success", "text": "{0}{1}" }, { "operator": "==", "thresholdValue": "Failed", "representation": "failed", "text": "{0}{1}" }, { "operator": "==", "thresholdValue": "Running", "representation": "pending", "text": "{0}{1}" }, { "operator": "Default", "thresholdValue": null, "representation": "more", "text": "{0}{1}" } ] } }, { "columnMatch": "View", "formatter": 7, "formatOptions": { "linkTarget": "OpenBlade", "linkLabel": "View", "linkIsContextBlade": false, "bladeOpenContext": { "bladeName": "WorkflowMonitorBlade", "extensionName": "Microsoft_Azure_EMA", "bladeJsonParameters": "{\n \"id\": \"{LogicApp:id}/workflows/{WorkflowName}\",\n \"location\": \"{location}\",\n \"resourceId\": \"/workflows/{WorkflowName}/runs/{RunId}\",\n \"runProperties\": {\"waitEndTime\":\"{startTime}\",\"startTime\":\"{startTime}\",\"endTime\":\"{endTime}\",\"status\":\"{status}\",\"correlation\":{\"clientTrackingId\":\"{clientTrackingId}\"},\"workflow\":{\"id\":\"/workflows/{WorkflowName}/versions/{versionId}\",\"name\":\"{versionId}\",\"type\":\"workflows/versions\"},\"trigger\":{\"name\":\"{triggerName}\",\"startTime\":\"{startTime}\",\"endTime\":\"{endTime}\",\"scheduledTime\":\"{startTime}\",\"originHistoryName\":\"{RunId}\",\"correlation\":{\"clientTrackingId\":\"{clientTrackingId}\"},\"code\":\"{statusCode}\",\"status\":\"{status}\"},\"outputs\":{}},\n\"isReadOnly\": 1\n}" } } }, { "columnMatch": "TriggerName", "formatter": 7, "formatOptions": { "linkTarget": "ArmAction", "linkLabel": "Resubmit", "linkIsContextBlade": true, "armActionContext": { "path": "{LogicApp:id}/hostruntime/runtime/webhooks/workflow/api/management/workflows/{WorkflowName}/triggers/{TriggerName}/histories/{RunId}/resubmit?api-version=2018-11-01", "headers": [], "params": [], "responseType": "json", "httpMethod": "POST", "title": "Resubmit Workflow Run {RunId}", "description": "# This action will trigger a new run using the same trigger data from run {RunId}\n", "runLabel": "Resubmit Run" } } }, { "columnMatch": "Status", "formatter": 18, "formatOptions": { "thresholdsOptions": "icons", "thresholdsGrid": [ { "operator": "==", "thresholdValue": "Succeeded", "representation": "success", "text": "{0}{1}" }, { "operator": "==", "thresholdValue": "Failed", "representation": "failed", "text": "{0}{1}" }, { "operator": "Default", "thresholdValue": null, "representation": "more", "text": "{0}{1}" } ] } } ], "filter": true, "labelSettings": [ { "columnId": "status", "label": "Status" }, { "columnId": "TriggerName", "label": "Resubmit" } ] }, "sortBy": [] }, "conditionalVisibility": { "parameterName": "WorkflowName", "comparison": "isNotEqualTo" }, "name": "query - 2" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "requests\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\n|extend category = tostring(customDimensions[\"Category\"])\r\n|where category == \"Workflow.Operations.Actions\"\r\nand operation_Name=~'{WorkflowName}'\r\nand operation_Id=='{RunId}'\r\n|extend actionType=customDimensions[\"actionType\"], trackedProperties=customDimensions[\"trackedProperties\"]\r\n|project endTime = timestamp, name, actionType, status=resultCode, duration,trackedProperties,itemId, requestId=id\r\n\r\n\r\n//|project RunId=operation_Id, status, clientTrackingId=tostring(customDimensions1[\"prop__clientTrackingId\"]), //version = tostring(customDimensions1[\"prop__flowSequenceId\"]), startTime=timestamp,endTime=timestamp1\r\n\r\n\r\n\r\n", "size": 0, "title": "Completed Actions for Workflow Run {RunId}", "timeContextFromParameter": "TimeRange", "exportFieldName": "requestId", "exportParameterName": "requestId", "queryType": 0, "resourceType": "microsoft.insights/components", "crossComponentResources": [ "{ApplicationInsights}" ], "gridSettings": { "formatters": [ { "columnMatch": "itemId", "formatter": 7, "formatOptions": { "linkTarget": "RequestDetails", "linkLabel": "Details", "linkIsContextBlade": true } }, { "columnMatch": "requestId", "formatter": 5 }, { "columnMatch": "Status", "formatter": 18, "formatOptions": { "thresholdsOptions": "icons", "thresholdsGrid": [ { "operator": "==", "thresholdValue": "Succeeded", "representation": "success", "text": "{0}{1}" }, { "operator": "==", "thresholdValue": "Failed", "representation": "failed", "text": "{0}{1}" }, { "operator": "Default", "thresholdValue": null, "representation": "more", "text": "{0}{1}" } ] } } ], "filter": true, "labelSettings": [ { "columnId": "duration", "label": "durationInMilliseconds" }, { "columnId": "itemId", "label": "Details" } ] } }, "conditionalVisibility": { "parameterName": "RunId", "comparison": "isNotEqualTo" }, "name": "query - 4" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "dependencies\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\nand operation_Name=~'{WorkflowName}'\r\nand operation_Id=='{RunId}'\r\n|where operation_ParentId == '{requestId}'\r\n|project timestamp, target, ['type'], name, resultCode, duration, itemId", "size": 1, "title": "Dependencies for the selected action", "timeContextFromParameter": "TimeRange", "queryType": 0, "resourceType": "microsoft.insights/components", "crossComponentResources": [ "{ApplicationInsights}" ], "gridSettings": { "formatters": [ { "columnMatch": "itemId", "formatter": 7, "formatOptions": { "linkTarget": "DependencyDetails", "linkLabel": "Details", "linkIsContextBlade": true } } ], "labelSettings": [ { "columnId": "itemId", "label": "Details" } ] } }, "name": "query - 3" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "exceptions\r\n|where cloud_RoleName =~ '{LogicApp:name}'\r\nand operation_Name=~'{WorkflowName}'\r\nand operation_Id=='{RunId}'\r\n|where operation_ParentId == '{requestId}'\r\n|project timestamp, problemId, ['type'], outerMessage, itemId", "size": 1, "title": "Exceptions for the selected action", "timeContextFromParameter": "TimeRange", "queryType": 0, "resourceType": "microsoft.insights/components", "crossComponentResources": [ "{ApplicationInsights}" ], "gridSettings": { "formatters": [ { "columnMatch": "itemId", "formatter": 7, "formatOptions": { "linkTarget": "ExceptionDetails", "linkLabel": "Details", "linkIsContextBlade": true } } ], "labelSettings": [ { "columnId": "itemId", "label": "Details" } ] } }, "name": "query - 4" } ], "fallbackResourceIds": [ "Azure Monitor" ], "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json" } } } ] }