How to escape double quotes in ARM templates

This will be a very short post, but it’s something that drove me crazy while adding OMS deployment and configuration to my automated deployment and configuration of our internal application and underlying infrastructure using PowerShell, PowerShell DSC and ARM templates.  As a part of this deployment, I wanted to include saved queries which are required to create alerts, but I was unable to figure out how to escape the double quotes needed in OMS search for queries such as the following:


As you can see, JSON does not like double quotes within double quotes, which makes sense.  The question is how do we escape the double quotes?  After a bit of research I was able to track down a sample template and find the answer.  Simply add a back-slash before each double quote and the issue is solved!  See below for an example.


Hopefully this will save somebody a bit of time in the future as we inevitably move towards increased automation!


Application Insights Added to OMS License

I am currently working on a monitoring and analytics solution for an internal managed service application and I was surprised to find that there isn’t more posted about the addition of Application Insights to the OMS E1 and E2 licenses.  In my opinion, this addition is huge, and in my case was a game-changer in driving adoption of OMS over other competitors.  Granted, the application in my scenario is fairly lightweight so the node and data limitations are far more than we will consume.

For those that missed this announcement, here is the link.


The New and Improved AD Management Packs are here!

I blogged earlier this year about a great post describing how the Microsoft AD team was re-engineering the AD management packs.  Well, after many months, the mps have been delivered!  Even better, they include 2012 and 2016.  There are a ton of changes in the new management packs which Kevin Holman covers here.  See here for a great behind the scenes description of the changes and process from earlier this year.

Exciting stuff!

Monitor and Recover Stopped Automatic Services with OMS – Part 1

I was working with a customer recently and one of the asks was to configure OMS to monitor for stopped automatic services on servers throughout the environment.  My first thought was that we could easily use the data collected by the Configuration Tracking solution and configure queries to alert when a service is stopped.  Unfortunately, although Configuration Tracking is a great solution, for this purpose it did not meet the requirements due to the 1 hour data collection interval.  We needed to be notified of the critical service stopping as close to real-time as possible.  Plan B was to utilize Event ID 7024 and custom fields as we were already collecting the Application log.  However, during my testing on Windows Server 2012 R2, the only event logged to the Application log when a service was stopped manually was Event ID 1.  Further, what if a service just doesn’t start after reboot?   Once again, there may be no events logged as technically there could be no error. 

SO…although technically both of the other options could work in certain scenarios, in this particular case we needed something a bit more granular.  Time for some fun with PowerShell, Azure Automation and the Data Collector API!

Continue reading

Service Map has arrived!

The long awaited Service Map (formerly known as Application Dependency Monitor) has been released for public preview.  Check out the blog link below for excellent details and a video further explaining the service and I’ll be following this up with more details of my own once I’m able to sleep for more than a few hours per night (newborn :)).

Schedule an Azure Automation Runbook Using Minutes

I was working with a customer recently and we realized that when using the “Schedule” functionality the most granular re-occurrence interval available is 1 hour.  In this particular case, we needed to check service status every 5 minutes and send the data to OMS to alert and trigger a remediation runbook, so 1 hour would not suffice.  I had recently spoken with a member of the product group around a custom OMS solution and specifically remembered him saying that his runbook was running every 5 minutes….so I was off to investigate!

After a few minutes of searching, I was able to find some good information here.  Although the post referenced the Classic portal, the same basic process still applies and worked in my scenario.  By using a Scheduler Collection we can schedule at a much more granular interval.  I’ve outlined the process in the new portal below.

Continue reading

New OMS Health State Threshold in View Designer

I was working with a customer today developing a custom solution with View Designer and noticed a new feature. We can now use thresholds for queries in the List section of View Designer blades which map to color indicators, which is very cool! The thresholds and colors are both editable, but the default colors are the standard red, yellow and green. This new feature makes identifying critical and warning values in OMS performance solutions much more simple, in addition to adding aesthetic value.

To access the Thresholds feature, simply click on your solution and select Edit.  Once in edit, click on the blade where you would like to add thresholds, check the “Enable Thresholds” box, and configure your thresholds.



There is one limitation that I’ve seen so far, and that is the inability to use < in the threshold settings. For counters like % free, we need the ability to use < instead of the hard-coded > value.

Update:  Until < is available in threshold settings, Stanislav Zhelyazkov points out a simple workaround using reverse logic here.