Skip to content

Commit daea702

Browse files
Update auto-instrumentation-troubleshoot.md
1 parent 2dc8869 commit daea702

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ 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-
### Auto‑instrumentation fails when .NET Core Hosting Startup assemblies are overridden
38-
ASP.NET Core auto‑instrumentation 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, via WebHostDefaults.HostingStartupAssembliesKey), that configuration overrides the App Service environment settings.
37+
### Autoinstrumentation fails when .NET Core Hosting Startup assemblies are overridden
3938

40-
When this occurs and Microsoft.ApplicationInsights.StartupBootstrapper is not included, the Application Insights agent cannot attach and telemetry will not be collected, even though Application Insights appears enabled in the Azure portal.
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.
4140

42-
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, note that host configuration takes precedence over the ASPNETCORE_HOSTINGSTARTUPASSEMBLIES environment variable, then follow the sample shown in the public docs [here](https://learn.microsoft.com/aspnet/core/fundamentals/host/platform-specific-configuration?view=aspnetcore-8.0#specify-the-hosting-startup-assembly).
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).
4344

4445
### A diagnostics library is detected
4546

0 commit comments

Comments
 (0)