Add comprehensive applicationinsights.config support#3069
Merged
rajkumar-rangaraj merged 3 commits intomainfrom Jan 7, 2026
Merged
Add comprehensive applicationinsights.config support#3069rajkumar-rangaraj merged 3 commits intomainfrom
rajkumar-rangaraj merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR significantly expands the applicationinsights.config XML configuration support for classic ASP.NET applications, moving from a simple connection string-only configuration to a comprehensive 12-property system that enables control over telemetry behavior, sampling strategies, storage options, and feature toggles.
Key Changes:
- Introduced
ApplicationInsightsConfigOptionsto encapsulate 12 configuration properties (connection string, telemetry control, sampling, storage, and feature flags) - Implemented
ApplicationInsightsConfigurationReaderwith culture-invariant XML parsing and type conversion - Enhanced
ApplicationInsightsHttpModuleto read and apply all configuration settings via OpenTelemetry integration using reflection for internal properties
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
examples/ClassicAspNetWebApp/applicationinsights.config |
Updated example configuration with all 12 properties enabled for testing purposes |
WEB/Src/Web/Web/net462/ApplicationInsights.config.install.xdt |
Added XDT transformations to install 8 properties (connection string, sampling settings, and feature flags) with detailed comments |
WEB/Src/Web/Web/net462/ApplicationInsights.config.uninstall.xdt |
Added removal directives for all installed properties plus legacy properties for backward compatibility |
WEB/Src/Web/Web/applicationinsights.config.sample |
Comprehensive sample configuration with detailed documentation, organized sections, and default values |
WEB/Src/Web/Web/Implementation/ApplicationInsightsConfigOptions.cs |
New internal class defining 12 configuration properties with XML documentation |
WEB/Src/Web/Web/Implementation/ApplicationInsightsConfigurationReader.cs |
Enhanced reader supporting all configuration properties with culture-invariant parsing and graceful error handling |
WEB/Src/Web/Web/ApplicationInsightsHttpModule.cs |
Enhanced initialization to read full configuration, apply settings to TelemetryConfiguration, and configure OpenTelemetry with reflection-based internal property access |
WEB/Src/Web/Web/Web.csproj |
Added AI_CLASSIC_WEB compilation constant and linked ActivityFilterProcessor for activity filtering support |
NETCORE/src/Shared/ActivityFilterProcessor.cs |
Extended with AI_CLASSIC_WEB conditional compilation to support classic ASP.NET with constructor accepting boolean parameters |
WEB/Src/Web/Web.Tests/ApplicationInsightsConfigurationReaderTests.cs |
14 comprehensive tests covering XML parsing, type conversion, culture-invariant parsing, and error handling |
WEB/Src/Web/Web.Tests/ApplicationInsightsHttpModuleTests.cs |
10 tests validating module initialization, configuration application, and singleton pattern |
WEB/Src/Web/Web.Tests/SampleConfigValidationTests.cs |
5 tests ensuring sample configuration validity, parsing correctness, and property completeness |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
harsimar
reviewed
Jan 7, 2026
harsimar
reviewed
Jan 7, 2026
harsimar
reviewed
Jan 7, 2026
harsimar
reviewed
Jan 7, 2026
harsimar
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands applicationinsights.config from ConnectionString-only to support 12 configurable properties for WEB SDK 3.x, enabling users to configure telemetry behavior, sampling, storage, and feature flags through XML configuration.
Changes
Core Implementation
Configuration Properties Added
OpenTelemetry Integration
TelemetryConfiguration.ConfigureOpenTelemetryBuilder()for OpenTelemetry-specific configurationNuGet Package Support
Documentation & Examples
Testing