You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.
Publish to Azure WebApp and verify that telemetry is being sent to ikey1
Add AppSetting to WebApp: APPINSIGHTS_INSTRUMENTATIONKEY pointing to ikey2
Expected: telemetry continues to be sent to ikey1, because settings in code take priority Actual: telemetry now is being sent to ikey2, while QuickPulse events continue to go to ikey1.
The text was updated successfully, but these errors were encountered:
AlexBulankou
changed the title
APPINSIGHTS_INSTRUMENTATIONKEY overrides ikey specified in code
APPINSIGHTS_INSTRUMENTATIONKEY AppSetting overrides ikey specified in code
Nov 29, 2016
Since I took a look at code anyway - there are two places we set the key from the env variable:
This will not respect TelemetryConfiguration.Active.InstrumentationKey = "ikey1";, but will work when you set new TelemetryClient("ikey1").TrackTrace("trace"):
This logic will not "override" the setting from the configuration file, but TelemetryConfiguration.Active.InstrumentationKey = "ikey1";, will override it:
There is one small problem here, how do you tell the difference between a value in TelemetryConfiguration.Active.InstrumentationKey that was set explicitly in code from one that TelemetryConfigurationFactory.Instance.Initialize placed there from reading the config entry?
Create 4.6 Web Application, enable Application Insights SDK 2.2 Beta 4 and specify in Global.asax.cs:
TelemetryConfiguration.Active.InstrumentationKey = "ikey1";
Publish to Azure WebApp and verify that telemetry is being sent to ikey1
Add AppSetting to WebApp: APPINSIGHTS_INSTRUMENTATIONKEY pointing to ikey2
Expected: telemetry continues to be sent to ikey1, because settings in code take priority
Actual: telemetry now is being sent to ikey2, while QuickPulse events continue to go to ikey1.
The text was updated successfully, but these errors were encountered: