fix: pin App Insights WorkerService to 2.x (isolated-worker startup crash)#6
Merged
Merged
Conversation
…artup crash The deployed Function App crashed on startup (dotnet exit 134) with: System.TypeLoadException: Could not load type 'Microsoft.ApplicationInsights.Extensibility.ITelemetryInitializer' from assembly 'Microsoft.ApplicationInsights, Version=3.1.2...' so no functions loaded and the API returned 502 / no response. Microsoft.ApplicationInsights.WorkerService 3.1.2 pulls Microsoft.ApplicationInsights 3.x, whose type layout is incompatible with Microsoft.Azure.Functions.Worker.ApplicationInsights (2.x). Pinning WorkerService to 2.22.0 resolves Microsoft.ApplicationInsights back to the 2.x line (2.23.0), matching the Functions worker AI integration. Build stays 0 warnings / 0 errors with -warnaserror. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude Bot
pushed a commit
that referenced
this pull request
Jun 22, 2026
…(prod recovery) (#23) INCIDENT 2026-06-22: Dependabot PR #22 bumped Microsoft.ApplicationInsights.WorkerService 2.22.0 -> 3.1.2 (reverting PR #6's pin); auto-merge + CD shipped it and the isolated worker crash-looped on startup (TypeLoadException: ITelemetryInitializer; host served 502). WorkerService 3.x pulls Microsoft.ApplicationInsights 3.x, incompatible with Worker.ApplicationInsights 2.x. Recovery: - Re-pin WorkerService to 2.22.0 (exact pin; resolves Microsoft.ApplicationInsights back to 2.23.0, the proven-good state). Build -c Release -warnaserror 0/0. Prevent recurrence (the comment alone wasn't a guard — Dependabot overrode it): - .github/dependabot.yml: ignore semver-major updates for Microsoft.ApplicationInsights.WorkerService AND Microsoft.ApplicationInsights. This ignore rule is the real enforcement. - Strengthened the csproj comment to reference PR #6, PR #22, this outage, and the ignore rule. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Fixes a startup crash discovered during the first deploy of the Function App. The isolated worker exited with code 134 on boot:
No functions loaded; the deployed API returned 502 / no response on every route.
Root cause
Microsoft.ApplicationInsights.WorkerService3.1.2 pulls inMicrosoft.ApplicationInsights3.x, whose type layout is incompatible withMicrosoft.Azure.Functions.Worker.ApplicationInsights(2.51.0), which expectsITelemetryInitializerfrom the 2.x assembly. The mismatch throwsTypeLoadExceptionand crashes the host.Fix
Pin
Microsoft.ApplicationInsights.WorkerServiceto 2.22.0, which resolvesMicrosoft.ApplicationInsightsback to the 2.x line (2.23.0) — the version pairing the Functions worker App Insights integration. No application logic changed; onePackageReferenceversion + an explanatory comment.Validation
dotnet build -c Release -warnaserror→ 0 warnings / 0 errorsdotnet list package --include-transitive→Microsoft.ApplicationInsights 2.23.0(was 3.1.2)After merge, the app is redeployed and verified end-to-end (
GET /api/checks,GET /api/sla).🤖 Generated with Claude Code