Last active
March 8, 2017 08:46
-
-
Save milannankov/81f3295827e9d9fd9cfd5c7e13c6a408 to your computer and use it in GitHub Desktop.
Disable or Enable Application Insights For Multiple Environments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
InitAppInsights(); | |
} | |
private static void InitAppInsights() | |
{ | |
// Add AppInsights:InstrumentationKey appSetting to web.config | |
// <add key="AppInsights:InstrumentationKey" value="" /> | |
TelemetryConfiguration.Active.InstrumentationKey = | |
ConfigurationManager.AppSettings["AppInsights:InstrumentationKey"]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment