-
Notifications
You must be signed in to change notification settings - Fork 293
Description
Deprecating Instrumentation Key based SDK configuration in favor of Connection String.
More information:
- Transition to using connection strings for data ingestion by 31 March 2025
- Migrate from Instrumentation Keys to Connection Strings
- Azure Monitor Connection Strings
Summary of Changes
-
-
TelemetryConfiguration
SettingInstrumentationKeyvia constructor or via property is marked Obsolete.
Use the default constructor and set theConnectionStringproperty instead. -
TelemetryClient
SettingInstrumentationKeyproperty is marked Obsolete.
Use the constructor to provide aTelemetryConfigurationwithConnectionStringset.
-
-
Microsoft.Extensions.Logging.ApplicationInsights
- Setting
InstrumentationKeyviaAddApplicationInsights()extension method is marked Obsolete.
Use the overload which acceptsAction<TelemetryConfiguration>and setTelemetryConfiguration.ConnectionString.
- Setting
-
Microsoft.ApplicationInsights.AspNetCore and Microsoft.ApplicationInsights.WorkerService
-
ApplicationInsightsServiceOptions
TheInstrumentationKeyproperty is marked Obsolete.
UseConnectionStringproperty instead. -
ExtensionMethods
-
Setting
InstrumentationKeyviaAddApplicationInsightsTelemetry()extension method is marked Obsolete.
Use the overload which acceptsAction<ApplicationInsightsServiceOptions>and setApplicationInsightsServiceOptions.ConnectionString. -
Setting
InstrumentationKeyviaAddApplicationInsightsTelemetryWorkerService()extension method is marked Obsolete.
Use the overload which acceptsAction<ApplicationInsightsServiceOptions>and setApplicationInsightsServiceOptions.ConnectionString. -
Setting
InstrumentationKeyviaAddApplicationInsightsSettings()extension method is marked Obsolete.
Use the overload which acceptsstring connectionString.
-
-
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.