{"id":572,"date":"2020-02-27T03:36:25","date_gmt":"2020-02-27T03:36:25","guid":{"rendered":"http:\/\/draith.azurewebsites.net\/?p=572"},"modified":"2020-02-27T03:36:25","modified_gmt":"2020-02-27T03:36:25","slug":"monitor-your-logic-apps-with-log-analytics-preview","status":"publish","type":"post","link":"https:\/\/draith.com\/?p=572","title":{"rendered":"Monitor your Logic Apps with Log Analytics (Preview)"},"content":{"rendered":"\n<p class=\"has-text-align-left\">This is a continuation of the blog series that fellow MVP Billy York and I are putting on around the journey from on-prem SCORCH to Automation in Azure.  In this post we will look at a new preview Log Analytics solution that will help you monitor and respond to issues that will invariably happen with Logic Apps.<\/p>\n\n\n\n<p>Logic App Management allows heavy users of Logic Apps to get both &#8216;at-a-glance&#8217; updates on the success or failure of their apps, or drill down deeply into app runs and get details such as start\/stop time, execution duration, action durations, etc&#8230;  It is especially useful when you have a very large set of Logic Apps.  Trying to get a single pane of glass when you have dozens or hundreds of Logic Apps is difficult with this exciting preview feature.<\/p>\n\n\n\n<p>To add this solution to Log Analytics, you will need&#8230;..wait for it&#8230;..a Log Analytics workspace!  Your existing Log Analytics workspace will do just fine &#8211; no need to create a new one.  In fact, there are a lot of reasons why you wouldn&#8217;t want to!  Once you have an eligible workspace, it&#8217;s time to add the solution.  You can get to this either by adding a resource to the resource group, or adding the solution directly from the workspace &#8211; both will start same wizard<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"411\" src=\"\/wp-content\/uploads\/2020\/02\/image-3-1024x411.png\" alt=\"\" class=\"wp-image-573\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-3-1024x411.png 1024w, \/wp-content\/uploads\/2020\/02\/image-3-300x121.png 300w, \/wp-content\/uploads\/2020\/02\/image-3-768x309.png 768w, \/wp-content\/uploads\/2020\/02\/image-3-1536x617.png 1536w, \/wp-content\/uploads\/2020\/02\/image-3-2048x823.png 2048w, \/wp-content\/uploads\/2020\/02\/image-3-1200x482.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>One option to add the solution is to do it directly from your Log Analytics workspace.<\/figcaption><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"677\" height=\"514\" src=\"\/wp-content\/uploads\/2020\/02\/image-4.png\" alt=\"\" class=\"wp-image-574\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-4.png 677w, \/wp-content\/uploads\/2020\/02\/image-4-300x228.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><figcaption>Searching for the solution&#8230;<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"408\" src=\"\/wp-content\/uploads\/2020\/02\/image-5-1024x408.png\" alt=\"\" class=\"wp-image-575\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-5-1024x408.png 1024w, \/wp-content\/uploads\/2020\/02\/image-5-300x120.png 300w, \/wp-content\/uploads\/2020\/02\/image-5-768x306.png 768w, \/wp-content\/uploads\/2020\/02\/image-5-1536x612.png 1536w, \/wp-content\/uploads\/2020\/02\/image-5-2048x816.png 2048w, \/wp-content\/uploads\/2020\/02\/image-5-1200x478.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>The actual solution is still in preview, but is very stable.<\/figcaption><\/figure>\n\n\n\n<p>The actual wizard is very simple &#8211; just pick your workspace and click create.  Once you have your solution provisioned, you can turn it on or off per Logic App by selecting the &#8220;Diagnostic Settings&#8221; on the LA and editing the setting below &#8211; if you want to turn it off, just uncheck the &#8220;Send to Log Analytics&#8221; setting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"93\" src=\"\/wp-content\/uploads\/2020\/02\/image-6-1024x93.png\" alt=\"\" class=\"wp-image-577\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-6-1024x93.png 1024w, \/wp-content\/uploads\/2020\/02\/image-6-300x27.png 300w, \/wp-content\/uploads\/2020\/02\/image-6-768x69.png 768w, \/wp-content\/uploads\/2020\/02\/image-6-1536x139.png 1536w, \/wp-content\/uploads\/2020\/02\/image-6-2048x185.png 2048w, \/wp-content\/uploads\/2020\/02\/image-6-1200x109.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"423\" src=\"\/wp-content\/uploads\/2020\/02\/image-7-1024x423.png\" alt=\"\" class=\"wp-image-578\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-7-1024x423.png 1024w, \/wp-content\/uploads\/2020\/02\/image-7-300x124.png 300w, \/wp-content\/uploads\/2020\/02\/image-7-768x317.png 768w, \/wp-content\/uploads\/2020\/02\/image-7-1536x634.png 1536w, \/wp-content\/uploads\/2020\/02\/image-7-1200x495.png 1200w, \/wp-content\/uploads\/2020\/02\/image-7.png 1613w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>For this article, I setup a couple of simple Logic Apps &#8211; both of them query RSS feeds, but one has a good feed URL, and the other doesn&#8217;t.  I varied their start times a bit just to show some contrasting data.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"996\" height=\"396\" src=\"\/wp-content\/uploads\/2020\/02\/image-8.png\" alt=\"\" class=\"wp-image-579\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-8.png 996w, \/wp-content\/uploads\/2020\/02\/image-8-300x119.png 300w, \/wp-content\/uploads\/2020\/02\/image-8-768x305.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>The good logic app&#8230;..<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"414\" src=\"\/wp-content\/uploads\/2020\/02\/image-9.png\" alt=\"\" class=\"wp-image-580\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-9.png 987w, \/wp-content\/uploads\/2020\/02\/image-9-300x126.png 300w, \/wp-content\/uploads\/2020\/02\/image-9-768x322.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>And the bad one &#8211; this URL doesn&#8217;t actually work.<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>I let these apps run for a couple of days.  When I look at my Log Analytics workspace, I am greeted with this new tile, and can drill down into to get a nice Logic App run overview:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"312\" src=\"\/wp-content\/uploads\/2020\/02\/image-10-1024x312.png\" alt=\"\" class=\"wp-image-582\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-10-1024x312.png 1024w, \/wp-content\/uploads\/2020\/02\/image-10-300x91.png 300w, \/wp-content\/uploads\/2020\/02\/image-10-768x234.png 768w, \/wp-content\/uploads\/2020\/02\/image-10.png 1168w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>New tile!<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"\/wp-content\/uploads\/2020\/02\/image-11-1024x532.png\" alt=\"\" class=\"wp-image-583\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-11-1024x532.png 1024w, \/wp-content\/uploads\/2020\/02\/image-11-300x156.png 300w, \/wp-content\/uploads\/2020\/02\/image-11-768x399.png 768w, \/wp-content\/uploads\/2020\/02\/image-11-1536x798.png 1536w, \/wp-content\/uploads\/2020\/02\/image-11-1200x623.png 1200w, \/wp-content\/uploads\/2020\/02\/image-11.png 1664w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>And some awesome graphs!!!<\/figcaption><\/figure>\n\n\n\n<p>This is a great overview screen for your apps.  Notice that the central graph is slightly off &#8211; I have tried it in multiple browsers on multiple themes, but it shows the same in each.  Hence the &#8216;preview&#8217; moniker on the solution, I guess.  Regardless, at a simple glance I can see the LAs that have succeeded or failed, get a list of the errors, and see a visual comparison of the status of my apps.  Clicking on the &#8216;runs&#8217; tab brings me to a bit more details, and if I click on the &#8220;See All&#8221; link in the bottom left of each tile, I get a familiar looking interface \ud83d\ude42<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"273\" src=\"\/wp-content\/uploads\/2020\/02\/image-12-1024x273.png\" alt=\"\" class=\"wp-image-585\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-12-1024x273.png 1024w, \/wp-content\/uploads\/2020\/02\/image-12-300x80.png 300w, \/wp-content\/uploads\/2020\/02\/image-12-768x204.png 768w, \/wp-content\/uploads\/2020\/02\/image-12-1536x409.png 1536w, \/wp-content\/uploads\/2020\/02\/image-12-2048x545.png 2048w, \/wp-content\/uploads\/2020\/02\/image-12-1200x320.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>A bit more detail&#8230;&#8230;<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"518\" src=\"\/wp-content\/uploads\/2020\/02\/image-14-1024x518.png\" alt=\"\" class=\"wp-image-587\" srcset=\"\/wp-content\/uploads\/2020\/02\/image-14-1024x518.png 1024w, \/wp-content\/uploads\/2020\/02\/image-14-300x152.png 300w, \/wp-content\/uploads\/2020\/02\/image-14-768x388.png 768w, \/wp-content\/uploads\/2020\/02\/image-14-1536x777.png 1536w, \/wp-content\/uploads\/2020\/02\/image-14-2048x1035.png 2048w, \/wp-content\/uploads\/2020\/02\/image-14-1200x607.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption>Our old friend &#8211; Kusto!<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>For anyone wanting to know the actual query, here it is:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;sql&quot;,&quot;mime&quot;:&quot;text\/x-sql&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;SQL&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;sql&quot;}\">AzureDiagnostics\n| where Category == &quot;WorkflowRuntime&quot;\n| where OperationName == &quot;Microsoft.Logic\/workflows\/workflowRunCompleted&quot;\n| join kind = rightouter\n(\n    AzureDiagnostics\n    | where Category == &quot;WorkflowRuntime&quot;\n    | where OperationName == &quot;Microsoft.Logic\/workflows\/workflowRunStarted&quot;\n    | where resource_runId_s in (( AzureDiagnostics\n    | where Category == &quot;WorkflowRuntime&quot;\n    | where OperationName == &quot;Microsoft.Logic\/workflows\/workflowTriggerCompleted&quot;\n    | project resource_runId_s ))\n    | project WorkflowStartStatus=status_s, WorkflowNameFromInnerQuery=resource_workflowName_s, WorkflowIdFromInnerQuery=workflowId_s, resource_runId_s\n)\non resource_runId_s\n| extend WorkflowStatus=iff(isnotempty(status_s), status_s, WorkflowStartStatus)\n| extend WorkflowName=iff(isnotempty(resource_workflowName_s), resource_workflowName_s, WorkflowNameFromInnerQuery)\n| extend WorkflowId=iff(isnotempty(workflowId_s), workflowId_s, WorkflowIdFromInnerQuery)\n| summarize Count=count() by WorkflowId, WorkflowName, WorkflowStatus<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>The benefits of having this data in the &#8220;Gateway Drug&#8221; (trademark pending) of Azure &#8211; Log Analytics  &#8211; should be obvious.  Want to export your Logic App data to PowerBI, or even better setup alerts when a LA fails?  Combine your LA data with feeds from AAD, Graph, Office365, etc&#8230;.  Having all of this data in an easily queried repository is priceless.  <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a continuation of the blog series that fellow MVP Billy York and I are putting on around the journey from on-prem SCORCH to Automation in Azure. In this post we will look at a new preview Log Analytics solution that will help you monitor and respond to issues that will invariably happen with &hellip; <a href=\"https:\/\/draith.com\/?p=572\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Monitor your Logic Apps with Log Analytics (Preview)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,12,13],"class_list":["post-572","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-automation","tag-log-analytics","tag-logic-apps"],"_links":{"self":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=572"}],"version-history":[{"count":7,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/572\/revisions"}],"predecessor-version":[{"id":591,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/572\/revisions\/591"}],"wp:attachment":[{"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}