title: VS Application Insights for a Web App deployed to multiple environments
body: <p>I'm in the process of trialling MS Application Insgihts on a Web Application deployed to Azure.</p>
  
  <p>One thing that doesn't seem to be available out of the box is segregation of stats/anayltics by deployment environment.</p>
  
  <p>Just wondering has anyone done this already and how the went about achieving it?</p>
  
  <p>Here's what I was thinking.</p>
  
  <ul>
  <li><p>Create 4 seperate "Applications" within AI (each with their own App Name &amp; Component Id)</p></li>
  <li><p>Add a single ApplicationInsights.config to the Web Application Project</p></li>
  <li><p>Manually Add App.Config Transforms to the application to replace the ComponentName &amp; ComponentId at build time based on the Configuratoin (QA, UAT or Prod)</p></li>
  <li><p>Add Conditional Compilation Symbols to the Web Application Build Configurations (QA, UAT, PROD)</p></li>
  <li><p>Add "#if QA" pre-processor directives to the razor _layout view to swap in the correct ComponentId into the javascript snippet at build time.</p></li>
  </ul>
  
  <p>Thoughts?</p>