Deprecating Instrumentation Key based SDK configuration in favor of Connection String.
More information:
Summary of Changes
Config files
Users should refrain from setting the InstrumentationKey in text-based config files and instead set the ConnectionString.
ApplicationInsights.config
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
<ConnectionString>InstrumentationKey=00000000-0000-0000-0000-000000000000</ConnectionString>
</ApplicationInsights>
ASP.NET Core or Worker Service config:
{
"ApplicationInsights": {
"ConnectionString" : "InstrumentationKey=00000000-0000-0000-0000-000000000000;"
}
}
For Comments or Questions
Please open a new issue.
Deprecating Instrumentation Key based SDK configuration in favor of Connection String.
More information:
Summary of Changes
Microsoft.ApplicationInsights
TelemetryConfigurationSetting
InstrumentationKeyvia constructor or via property is marked Obsolete.Use the default constructor and set the
ConnectionStringproperty instead.TelemetryClientSetting
InstrumentationKeyproperty is marked Obsolete.Use the constructor to provide a
TelemetryConfigurationwithConnectionStringset.Microsoft.Extensions.Logging.ApplicationInsights
InstrumentationKeyviaAddApplicationInsights()extension method is marked Obsolete.Use the overload which accepts
Action<TelemetryConfiguration>and setTelemetryConfiguration.ConnectionString.Microsoft.ApplicationInsights.AspNetCore and Microsoft.ApplicationInsights.WorkerService
ApplicationInsightsServiceOptionsThe
InstrumentationKeyproperty is marked Obsolete.Use
ConnectionStringproperty instead.ExtensionMethods
Setting
InstrumentationKeyviaAddApplicationInsightsTelemetry()extension method is marked Obsolete.Use the overload which accepts
Action<ApplicationInsightsServiceOptions>and setApplicationInsightsServiceOptions.ConnectionString.Setting
InstrumentationKeyviaAddApplicationInsightsTelemetryWorkerService()extension method is marked Obsolete.Use the overload which accepts
Action<ApplicationInsightsServiceOptions>and setApplicationInsightsServiceOptions.ConnectionString.Setting
InstrumentationKeyviaAddApplicationInsightsSettings()extension method is marked Obsolete.Use the overload which accepts
string connectionString.Config files
Users should refrain from setting the
InstrumentationKeyin text-based config files and instead set theConnectionString.ApplicationInsights.config
ASP.NET Core or Worker Service config:
{ "ApplicationInsights": { "ConnectionString" : "InstrumentationKey=00000000-0000-0000-0000-000000000000;" } }For Comments or Questions
Please open a new issue.