<PackageReference Include="Microsoft.ApplicationInsights" Version="2.23.0" />

Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration

public sealed class TelemetryConfiguration : IDisposable
Encapsulates the global telemetry configuration typically loaded from the ApplicationInsights.config file.
public static TelemetryConfiguration Active { get; }

Gets the active TelemetryConfiguration instance loaded from the ApplicationInsights.config file. If the configuration file does not exist, the active configuration instance is initialized with minimum defaults needed to send telemetry to Application Insights.

Gets or sets the Application Id Provider.

public string ConnectionString { get; set; }

Gets or sets the connection string. Setting this value will also set (and overwrite) the InstrumentationKey. The endpoints are validated and will be set (and overwritten) for InMemoryChannel and ServerTelemetryChannel as well as the ApplicationIdProvider.

Gets the default telemetry sink.

public bool DisableTelemetry { get; set; }

Gets or sets a value indicating whether sending of telemetry to Application Insights is disabled.

Gets the Endpoint Container responsible for making service endpoints available.

public IList<string> ExperimentalFeatures { get; }

Gets a collection of strings indicating if an experimental feature should be enabled. The presence of a string in this collection will be evaluated as 'true'.

public string InstrumentationKey { get; set; }

Gets or sets the default instrumentation key for the application.

public ITelemetryChannel TelemetryChannel { get; set; }

Gets or sets the telemetry channel for the default sink. Will also attempt to set the Channel's endpoint.

Gets the list of ITelemetryInitializer objects that supply additional information about telemetry.

Gets the TelemetryProcessorChainBuilder which can build and populate TelemetryProcessors in the TelemetryConfiguration.

Gets a readonly collection of TelemetryProcessors.

Gets a list of telemetry sinks associated with the configuration.

Initializes a new instance of the TelemetryConfiguration class.

public TelemetryConfiguration(string instrumentationKey)

Initializes a new instance of the TelemetryConfiguration class.

public TelemetryConfiguration(string instrumentationKey, ITelemetryChannel channel)

Initializes a new instance of the TelemetryConfiguration class.

Creates a new TelemetryConfiguration instance loaded from the ApplicationInsights.config file. If the configuration file does not exist, the new configuration instance is initialized with minimum defaults needed to send telemetry to Application Insights.

public static TelemetryConfiguration CreateFromConfiguration(string config)

Creates a new TelemetryConfiguration instance loaded from the specified configuration.

public void Dispose()

Releases resources used by the current instance of the TelemetryConfiguration class.

public void SetAzureTokenCredential(object tokenCredential)

Set a TokenCredential for this configuration.