Update OpenTelemetry and Azure Monitor packages to address vulnerabilities#3174
Merged
rajkumar-rangaraj merged 2 commits intomainfrom May 1, 2026
Merged
Conversation
…ities - OpenTelemetry 1.15.1 -> 1.15.3 (Core, Console, InMemory, Hosting) - OpenTelemetry.Instrumentation.AspNetCore 1.15.0 -> 1.15.2 - OpenTelemetry.Instrumentation.AspNet 1.15.1 -> 1.15.2 - OpenTelemetry.Instrumentation.Http 1.15.0 -> 1.15.1 - OpenTelemetry.Instrumentation.SqlClient 1.15.0 -> 1.15.2 - Azure.Monitor.OpenTelemetry.Exporter 1.7.0 -> 1.8.0 Resolves NU1902 build error from GHSA-g94r-2vxg-569j (moderate severity vulnerability in OpenTelemetry.Api 1.15.1). Also adds InternalsVisibleTo for DynamicProxyGenAssembly2 so Moq/ Castle.DynamicProxy can subclass internal types (e.g. MemoryMappedFileHandler) in unit tests. This unblocks SelfDiagnosticsEventListenerTest.* (14 tests across net462/net8.0/net9.0/net10.0) which were failing because Microsoft.ApplicationInsights is strong-named.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates OpenTelemetry and Azure Monitor dependency versions across the repo to address known security advisories and restore successful restores/builds, and it also fixes test mocking for a strong-named assembly by enabling Moq/Castle to proxy internal types.
Changes:
- Bump OpenTelemetry core + instrumentation packages and Azure.Monitor.OpenTelemetry.Exporter via central package management.
- Add an
InternalsVisibleToentry forDynamicProxyGenAssembly2(with Moq public key) to re-enable mocking of internal types in tests. - Document the dependency bumps in
CHANGELOG.mdunder a new “Unreleased” section.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Directory.Packages.props | Updates centrally-managed package versions for OpenTelemetry + Azure Monitor exporter. |
| CHANGELOG.md | Adds an Unreleased entry documenting the dependency/security advisory updates. |
| BASE/src/Microsoft.ApplicationInsights/Properties/AssemblyInfo.cs | Adds InternalsVisibleTo for Castle/Moq dynamic proxy to mock internal types in a strong-named assembly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mattsains-msft
approved these changes
May 1, 2026
This was referenced May 8, 2026
Merged
This was referenced May 10, 2026
Open
Open
Open
Bump Microsoft.ApplicationInsights.WorkerService from 3.1.0 to 3.1.1
mspnp/cloud-design-patterns#500
Open
Open
Open
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.
What
Bumps OpenTelemetry and Azure Monitor dependencies to address known security advisories and unblock builds.
OpenTelemetryOpenTelemetry.Exporter.ConsoleOpenTelemetry.Exporter.InMemoryOpenTelemetry.Extensions.HostingOpenTelemetry.Instrumentation.AspNetCoreOpenTelemetry.Instrumentation.AspNetOpenTelemetry.Instrumentation.HttpOpenTelemetry.Instrumentation.SqlClientAzure.Monitor.OpenTelemetry.ExporterWhy
Building
Everything.slnagainst the previous versions fails withNU1902becauseOpenTelemetry.Api 1.15.1carries a moderate-severity advisory (GHSA-g94r-2vxg-569j). All transitively-required floor versions of dependencies (e.g.Azure.Core >= 1.54.0) are satisfied — no further pins needed.Test infra fix
This PR also adds:
to
BASE/src/Microsoft.ApplicationInsights/Properties/AssemblyInfo.cs. BecauseMicrosoft.ApplicationInsightsis strong-named, Castle.DynamicProxy (used by Moq) cannot subclass internal types likeMemoryMappedFileHandlerwithout it. TheMoqPublicKeyconstant was already defined in the same file but unused. This fix re-enables the 14SelfDiagnosticsEventListenerTest.*tests acrossnet462/net8.0/net9.0/net10.0.Validation
dotnet restore Everything.sln— cleandotnet build Everything.sln -c Release— 0 errors (baselinemainfails withNU1902)dotnet test Everything.sln -c Release—SelfDiagnosticstests now passing (14/14 across all TFMs); remaining 3 failure types are pre-existing flakes onmain(IMDS-dependentFeatureMetricEmissionHelperTests.ReportsFeaturesSeen, file-cleanup race inWeb.Tests, timing race inWorkerServiceTelemetryTests.BackgroundWorkOperationsAreExported) — out of scope for this change.