I've just enabled Application Insights in my MVC application and noticed that when debugging locally, that the trace information is being captured within my Azure Application Insight.
When in debug mode, I want to stop my app from recording the events within my Azure Application Insight but still display the Events and logging information in the Diagnostic Tools > Events window within Visual Studio.
I've tried the following and whilst this stop the events from being captured in my Azure AI, Visual Studio no longer displays the debug information in Events window.
protected void Application_Start()
{
#if DEBUG
TelemetryConfiguration.Active.DisableTelemetry = true;
#endif
}
I've surfed the net for an answer to no avail. Hope someone can help.