title: Adding custom properties for each request in Application Insights metrics
body: <p>I d'like to add custom properties to metrics taken by Application Insights <strong>to each request</strong> of my app. For example, I want to add the user login and the tenant code, such as I can segment/group the metrics in the Azure portal.</p>
  
  <p>The relevant doc page seems to be this one : <a href="https://azure.microsoft.com/en-us/documentation/articles/app-insights-api-custom-events-metrics/" rel="noreferrer">Set default property values</a></p>
  
  <p>But the example is for an event (i.e. <code>gameTelemetry.TrackEvent("WinGame");</code>), not for an HTTP request :</p>
  
  <pre><code>var context = new TelemetryContext();
  context.Properties["Game"] = currentGame.Name;
  var gameTelemetry = new TelemetryClient(context);
  gameTelemetry.TrackEvent("WinGame");
  </code></pre>
  
  <p>My questions :</p>
  
  <ol>
  <li>What is the relevant code for a request, as I have no specific code at this time (it seems to be automatically managed by the App Insights SDK) : Is just creating a <code>TelemetryContext</code> sufficient ? Should I create also a <code>TelemetryClient</code> and if so, should I link it to the current request ? How ?</li>
  <li>Where should I put this code ? Is it ok in the <code>Application_BeginRequest</code> method of <code>global.asax</code> ?</li>
  </ol>