Azure / Azure/azure-functions-dotnet-worker

Microsoft.ApplicationInsights.WorkerService 3.0.0 incompatible with Azure Functions Worker - Breaking change

Open
#3,322 9 comments 27 reactions 1 assignee Claimed by @RohitRanjanMS View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

## Summary

Microsoft.ApplicationInsights.WorkerService 3.0.0 introduces breaking changes that cause runtime failures when used with Azure Functions isolated worker model.

## Error

```
TypeLoadException: Could not load type 'Microsoft.ApplicationInsights.Extensibility.ITelemetryInitializer' from assembly 'Microsoft.ApplicationInsights, Version=3.0.0.1'
```

## Root Cause

Version 3.0.0 migrated to OpenTelemetry with breaking changes to `ITelemetryInitializer` and other extensibility points, which are incompatible with the current `Microsoft.Azure.Functions.Worker.ApplicationInsights` telemetry integration.

## Environment

- **Azure Functions Worker**: 2.51.0
- **Functions Worker ApplicationInsights**: 2.50.0
- **.NET**: 10.0
- **ApplicationInsights.WorkerService**: 3.0.0 (broken) / 2.22.0 (works)

## Steps to Reproduce

1. Create a new Azure Functions isolated worker project targeting .NET 10
2. Add the latest `Microsoft.ApplicationInsights.WorkerService` (3.0.0)
3. Add `Microsoft.Azure.Functions.Worker.ApplicationInsights` (2.50.0)
4. Run `func start`
5. Observe `TypeLoadException`

## Workaround

Use Microsoft.ApplicationInsights.WorkerService version **2.22.0** (latest stable 2.x) instead of 3.x:

```xml

```

## Impact

Projects upgrading to .NET 10 (or any supported .NET version) may inadvertently upgrade to ApplicationInsights 3.x and encounter runtime failures. This is a common scenario as developers typically update all NuGet packages to latest stable versions.

## Recommendation

1. **Short-term**: Document this compatibility constraint in the package README and release notes
2. **Long-term**: Update `Microsoft.Azure.Functions.Worker.ApplicationInsights` to support ApplicationInsights 3.x SDK with OpenTelemetry

## Related

- **Discovery context**: [Azure-Samples/functions-quickstart-dotnet-azd#26](https://github.com/Azure-Samples/functions-quickstart-dotnet-azd/pull/26) - .NET 10 upgrade PR where this was discovered

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.