APPINSIGHTS_INSTRUMENTATIONKEY
contains the instrumentation key for Application Insights.
APPLICATIONINSIGHTS_CONNECTION_STRING
contains the instrumentation key for Application Insights prefixed with InstrumentationKey=
.
That seems pointless unless each value enables certain features with Application Insights.
Looking at the release notes for SDK Version 2.0.12998
:
App Insights configuration will use the APPLICATIONINSIGHTS_CONNECTION_STRING app setting if it is set (APPINSIGHTS_INSTRUMENTATIONKEY is the fallback and continues to work as-is).
Furthermore, if you read the documentation for App Insights Connection String
, you will notice that when you use connection string, you can specify custom endpoints. This is not possible if you just specify the instrumentation key. In that case, SDK will connect to default endpoints.