Recently I found an IIS hosted web application that we couldn’t instrument with Application Insights. As it is running in IIS,
it is possible to start monitoring it with Application Insights through the Web platform Installer
. You can find how to do that
for example here.
Installation and configuration is rather straightforward.
What this post is about, is the files you need to take care of when you are deploying your web application with a Continuous Deployment pipeline, as we where doing. In that case you’ll find, that the connection with the Application Insights instance keeps getting lost.
Figuring out what was happening took some time and meticulously checking before and after of directories and file contents.
After taking care of the default settings in the ApplicationInsights.config
(instrumentation key) and web.config
(handlers),
we found out that we needed to include the binaries in the bin folder that the Status Monitor sneakily added to our application directory:
After adding these files (for example in an internal NuGet package) and including them during our deployment, the Status Monitor now stays connected and sending telemetry to you Application Insights instance.