MistyD
MistyD

Reputation: 17253

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.

Upvotes: 4

Views: 7474

Answers (1)

Joey Cai
Joey Cai

Reputation: 20127

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.

Upvotes: 4

Related Questions