This is useful - from https://stackoverflow.com/q/50717398/533460:
I've come to conclusion based on Tseng's answer that it is best practice to use APPINSIGHTS_INSTRUMENTATIONKEY in both, in Azure portal and in appsettings.json.
ASP.NET Core understands both APPINSIGHTS_INSTRUMENTATIONKEY and ApplicationInsights:InstrumentationKey, but Azure Portal only the first one and it has to be environment variable. If you used the second, and tried to read it from config somewhere in the code, you could easily end up with different values in Azure Portal and in your app running in Azure.
Also, if you are manually reading the instrumentation key from configuration, you should first look at APPINSIGHTS_INSTRUMENTATIONKEY and then to ApplicationInsights:InstrumentationKey:
var instrumentationKey= Configuration.GetSection("APPINSIGHTS_INSTRUMENTATIONKEY")?.Value
?? Configuration.GetSection("ApplicationInsights:InstrumentationKey")?.Value;
because that's how services.AddApplicationInsightsTelemetry(Configuration); works as well. Just in case there would be different setting key in Azure Portal than in appsettings.json