0

I am trying to turn on/off the appinsights in my asp.net code proramatically based on the flag returned from DB. When i research, I found the below settings in app_start. But not sure if the samething can be achieved in anywhere of the code dynamically

Disable application insights in debug

Please let me know your suggestions.

Thank you!

DevExpress
  • 99
  • 1
  • 2
  • 8

1 Answers1

0

Yes, it is possible. many people do similar to not necessarily "disable" AI, but to send telemetry to different resources based on environment (dev/test/staging/prod/etc)

https://blogs.msdn.microsoft.com/devops/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions/

you can disable telemetry the way the link you linked did, or you could send telemetry to different resources (or no resource at all)

John Gardner
  • 24,225
  • 5
  • 58
  • 76