Application Insights
Instrument a web application with the Application Insights SDK, explore the application map, and use Live Metrics Stream to diagnose issues in real time.
What Is Application Insights?
Application Insights is a feature of Azure Monitor that provides application performance monitoring (APM) for live web applications. It collects telemetry about requests, dependencies, exceptions, page views, and custom events. Unlike platform metrics that describe infrastructure health, Application Insights describes what your application code is doing and how end users experience it. It supports .NET, Node.js, Java, Python, and browser JavaScript.
Instrumenting Your Application
You add Application Insights to an application by installing the SDK or using auto-instrumentation (also called codeless attach). For App Service, enabling Application Insights from the portal installs the agent automatically with no code changes. For self-managed applications, you add the SDK package and provide the connection string (preferred over the older instrumentation key) from your Application Insights resource.
# Enable Application Insights on an App Service app
az webapp config appsettings set \
--name myApp \
--resource-group myRG \
--settings APPLICATIONINSIGHTS_CONNECTION_STRING='InstrumentationKey=...' \
ApplicationInsightsAgent_EXTENSION_VERSION='~3'