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.
APPINSIGHTS_INSTRUMENTATIONKEY is azure way of passing the key. ASP.NET Core syntax would only apply to ASP.NET Core apps, not to other kind of apps hosted on Azure. – Tseng.
Azure Functions can be monitored using Application Insights and Azure Monitor. Though Azure provides such monitoring solutions, users cannot monitor multiple entities with various metrics. Whereas, with Serverless360 monitoring, it is possible to monitor various entities based on metrics at the Application level.
Is Connection string a secret? Connection string contains iKey which is a unique identifier used by the ingestion service to associate telemetry to a specific Application Insights resource. It is not to be considered a security token or key.
In your function app, select Configuration under Settings, and then select Application settings. If you see a setting named APPINSIGHTS_INSTRUMENTATIONKEY , Application Insights integration is enabled for your function app running in Azure.
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.
One important thing to note is that if APPINSIGHTS_INSTRUMENTATIONKEY is removed from the Azure Function's configuration, the "Logs" entry in the "Monitoring" section in the Azure portal does not show logs anymore and instead asks you again to connect to an Application Insights resource. If you do so, the portal recreates the APPINSIGHTS_INSTRUMENTATIONKEY config setting.
This seems like a bug in the Azure portal since metrics and logs do continue to be collected. Also, funny enough "Log stream" continues to work as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With