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 ...