Skip to content

Commit 2ddb277

Browse files
Merge pull request #10470 from toddfoust/patch-5
AB#9050: Enhance troubleshooting for auto-instrumentation failures
2 parents ad0aeb9 + daea702 commit 2ddb277

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

support/azure/azure-monitor/app-insights/telemetry/auto-instrumentation-troubleshoot.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ To determine whether your version is supported, see the following .NET or .NET C
3434
- [Application monitoring for Azure App Service and ASP.NET](/azure/azure-monitor/app/azure-web-apps-net#application-monitoring-for-azure-app-service-and-aspnet)
3535
- [Application monitoring for Azure App Service and ASP.NET Core](/azure/azure-monitor/app/azure-web-apps-net-core#application-monitoring-for-azure-app-service-and-aspnet-core)
3636

37+
### Autoinstrumentation fails when .NET Core Hosting Startup assemblies are overridden
38+
39+
ASP.NET Core autoinstrumentation on Azure App Service uses the `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` mechanism to load the Application Insights startup bootstrapper at runtime. If an application explicitly configures hosting startup assemblies (for example, with `WebHostDefaults.HostingStartupAssembliesKey`), that configuration overrides the App Service environment settings.
40+
41+
When this occurs and `Microsoft.ApplicationInsights.StartupBootstrapper` is not included, the Application Insights agent can't attach and telemetry isn't collected even though Application Insights appears enabled in the Azure portal.
42+
43+
To resolve this, remove custom hosting startup configuration or ensure `Microsoft.ApplicationInsights.StartupBootstrapper` is explicitly included in the configured hosting startup assemblies. If you intend to control startup assemblies programmatically, host configuration takes precedence over the `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` environment variable. For more information, see [Use hosting startup assemblies in ASP.NET Core](/aspnet/core/fundamentals/host/platform-specific-configuration?view=aspnetcore-8.0#specify-the-hosting-startup-assembly).
44+
3745
### A diagnostics library is detected
3846

3947
Autoinstrumentation fails if it detects the following libraries:

0 commit comments

Comments
 (0)