Implementing Deployment Markers in Application Insights

Implementing Deployment Markers in Application Insights

Rate This
  • Comments 4

Application Insights is a set of services that integrates production monitoring data with development tools. In many of the demos you will see us opening the solution and code file directly from the production data. For instance in the screenshot below I can click on those blue dots it will take me directly to the specific changeset used to create that deployment- this is done through deployment markers.


Deployment markers are automatically generated by MSBuild – if you instruct it to do so. There are a couple of ways to give MSBuild parameters but since I wanted everything to continue working from within Visual Studio with F5 I needed to modify the project file. From within Visual Studio you need to right click on the project and choose “unload”


This puts the project into a mode you can edit it. (Seem image below)


At this point you need to insert the parameter GenerateBuildInfoConfigFile = True

See the article:

Diagnose problems in deployment with Visual Studio and Microsoft Monitoring Agent

In my case I also wanted the version and server name information so I actually added this to my project file:



    <!-- Generate the BuildInfo.config file -->



Now we should be able to reload the project, check it in, and when we enabled monitoring the deployment markers would be visible….Unfortunately it looks like the current MSBuild implementation is giving the BuildInfo.config file the name APPNAME.BuildInfo.Config and placing it in the BIN directory instead what is needed in the same directory as the Web.config and the file name BuildInfo.config

–but that is easy to fix via another MSBuild directive in the project file:

<Target Name="AfterBuild">

<Copy SourceFiles="C:\web\WebApplication1\WebApplication1\bin\WebApplication1.BuildInfo.CONFIG" DestinationFiles="C:\web\WebApplication1\WebApplication1\BUILDINFO.CONFIG" />



At this point we are done with the client. At your next deployment, if Application Insights is monitoring that App you will see the deployment marker.

So what do I need to do to get a new Application monitored and an availability test created (assuming the MMA is installed) ?

To see the deployment marker in Application Insights we need to enable monitoring.

Step 1 is add the application to the monitored applications by running Powershell as administrator and running the following command(this is how the BuildConfig file is picked up):

Start-WebApplicationMonitoring "Default Web Site/webapplication1" -Mode Monitor -OutputChannel Cloud -DisplayName webapp1


Step 2 is to create the availability test this is pretty just click on Availability menu – at which point you are prompted for the URL.


At this point you should see availability, performance (both outside in and internal application) AND your deployment markers as seen below



Leave a Comment
  • Please add 2 and 5 and type the answer here:
  • Post
  • Hmm, hardcoded full path to a file: why not a relative path??

  • @Niels ...definitely something I would suggest doing - in this case just wanted it very readable

  • Here is the target that is not hardcoded to the file:

    <Target Name="AfterBuild">

       <Copy SourceFiles="$(TargetDir)$(TargetName).BuildInfo.config" DestinationFiles="$(ProjectDir)BuildInfo.config" />


  • I've been trying to find out how to show deployment markers and associated info in the new Azure Portal (preview)  Application Insights, does anyone have any information that can help me? I've followed the instructions above and have a BuildInfo.config deploying with my applications. Fortunately I didn't need to move/copy the config file as it is deployed by default in the same directory as the Web.config.

    I am expecting to see the  info in the 'Events' blade of a web resource in Application Insights but I only see config changes made via the portal in there.

    Ideally I'd like as much info as possible to come through, such as who commited the changeset, what machine it was built on and so on, if anyone knows of another way to achieve this please let me know.

Page 1 of 1 (4 items)