Setting the Instrumentation Key in Application settings

In ASP.NET Core, the configuration system is built in a hierarchy in a way that a higher-level provider can override the configuration values that were set by a lower-level provider. By default, environment variables are highest in the hierarchy and will override other values for the same key.

To set environment variables inside your App Service environment, click on the Application settings menu item in the left-hand menu:

The APPINSIGHTS_INSTRUMENTATIONKEY setting was added automatically when you connected your App Service to Application Insights.

When the Application Insights logger ...

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.