Mar 152018
 
 March 15, 2018  Posted by at 2:54 am Azure, Azure Log Analytics  Add comments

The more I use Log Analytics the bigger the fan of Application Insights I’m becoming. The query language is fantastic, the Application Insights service and tooling around it amazing. Yesterday I added Application Insights logging in our QA environment as well, to track SQL queries in particular so we can create some clever queries that can help us figure out if we are having SQL related performance problems.

We use the Application Insights NuGet package for all our services (in our logging library), but the SQL queries weren’t being logged. A few years ago, when we hosted the services on Azure using Cloud Services we got everything out of the box, but this time I had to configure the environment manually. Here is how:

Install Application Insights using the Web Installer on the serverap-insights-sql-query-2

 

ap-insights-sql-query

Associate Application Insights with your account

ap-insights-sql-query-4

Restart IIS

Add the service account running your web services to the Performance Monitor Users groups

ap-insights-sql-query-5

Give it a minute or two and the queries should start showing up in Log Analytics.

ap-insights-sql-query-7

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 15 + 9 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)