Enable Logic Apps Diagnostics within ARM Template

In my current project we are using Log Analytics (OMS) to log runs from Logic Apps. From the logged runs we get alerts when a Logic App run is failed. To enable Logic Apps diagnostics we first used a PowerShell script, run from a VSTS release step.

The problem with this is that both the log and metric are enabled.

Enable Logic Apps Diagnostics
Logic Apps Diagnostic Settings

Since we did not need the Metrics to be enabled we had to do it in another way. After some investigation on the net we found out that it was possible to add it to our ARM template.

Enable Logic Apps Diagnostics within ARM Template

The “resources” array should be within the “Microsoft.Logic/workflows” resource in the template, same level as “type”, “name” etc.

After deploying the template the metric checkbox is now unchecked.

Metrics unchecked
Logic Apps diagnostic settings metrics disabled

This example shows only how to configure diagnostic settings for Log Analytics. It is also possible to configure diagnostic settings for Storage Account or Event Hub.

More information

More detailed information about Logic Apps diagnostic settings can be found at Microsoft Azure documentation.

The diagnostics settings are now included in the LogicAppTemplateExtractor by Jeff Hollan, (my first contribution to a github project).

If you like it...

Leave a Reply

Your email address will not be published. Required fields are marked *