Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the warning 'TelemetryConfiguration.Active is obsolete' in Azure application insights

I updated my azure application insights and now I am getting the warning

'TelemetryConfiguration.Active is obsolete'

I currently have a method like this

static Load()
{
    var pchannel = new inMemoryChannel();
    .....
    TelemetryConfiguration.Active.TelemetryChannel = pchannel;
}

Do you think it will be safe to substitute

TelemetryConfiguration.Active.TelemetryChannel = pchannel;

with this

TelemetryConfiguration.CreateDefault().TelemetryChannel = pchannel;

This removes the warning.

like image 639
MistyD Avatar asked Sep 10 '25 03:09

MistyD


1 Answers

Since TelemetryConfiguration.Active is deprecated, in asp.net core app, we suggest to use var newConfig = TelemetryConfiguration.CreateDefault();

For more details, you could refer to this issue.

like image 81
Joey Cai Avatar answered Sep 12 '25 17:09

Joey Cai