Application Insights
Introduction
Section titled “Introduction”Azure Application Insights is an application performance management (APM) service for monitoring live applications. It automatically collects request rates, response times, failure rates, and dependency traces, surfacing them in a unified monitoring experience. Application Insights is commonly used to diagnose production issues, track custom business metrics, and set up availability alerts for distributed applications. For more information, see What is Application Insights?.
LocalStack for Azure provides a local environment for building and testing applications that make use of Azure Application Insights. The supported APIs are available on our API Coverage section, which provides information on the extent of Application Insights’ integration with LocalStack.
Getting started
Section titled “Getting started”This guide walks you through creating an Application Insights component and retrieving its instrumentation key.
Launch LocalStack using your preferred method. For more information, see Introduction to LocalStack for Azure. Once the container is running, enable Azure CLI interception by running:
azlocal start-interceptionThis command points the az CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API.
To revert this configuration, run:
azlocal stop-interceptionThis reconfigures the az CLI to send commands to the official Azure management REST API.
Create a resource group
Section titled “Create a resource group”Create a resource group to hold all resources created in this guide:
az group create --name rg-insights-demo --location westeurope{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-insights-demo", "location": "eastus", "name": "rg-insights-demo", "properties": { "provisioningState": "Succeeded" }, "type": "Microsoft.Resources/resourceGroups"}Create an Application Insights component
Section titled “Create an Application Insights component”Create an Application Insights component linked to a Log Analytics workspace:
az monitor app-insights component create \ --app my-app-insights \ --resource-group rg-insights-demo \ --location westeurope \ --kind web \ --application-type web{ "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "connectionString": "InstrumentationKey=xxxxxxxx-...;IngestionEndpoint=https://eastus.in.applicationinsights.azure.com/;...", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-insights-demo/providers/microsoft.insights/components/my-app-insights", "instrumentationKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "kind": "web", "location": "eastus", "name": "my-app-insights", "provisioningState": "Succeeded", "resourceGroup": "rg-insights-demo", "type": "microsoft.insights/components"...}Show and list components
Section titled “Show and list components”Retrieve the details of the component and list all components in the resource group:
az monitor app-insights component show \ --app my-app-insights \ --resource-group rg-insights-demo{ "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-insights-demo/providers/microsoft.insights/components/my-app-insights", "instrumentationKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "kind": "web", "name": "my-app-insights", "provisioningState": "Succeeded", "resourceGroup": "rg-insights-demo", "type": "microsoft.insights/components"...}Retrieve billing features
Section titled “Retrieve billing features”Retrieve the current billing features and daily data volume cap for the component:
az monitor app-insights component billing show \ --app my-app-insights \ --resource-group rg-insights-demo{ "currentBillingFeatures": ["Basic"], "dataVolumeCap": { "cap": 100.0, "maxHistoryCap": 1000.0, "resetTime": 0, "warningThreshold": 90 }}Update billing features
Section titled “Update billing features”Update the daily data volume cap to limit ingestion costs:
az monitor app-insights component billing update \ --app my-app-insights \ --resource-group rg-insights-demo \ --cap 100{ "currentBillingFeatures": ["Basic"], "dataVolumeCap": { "cap": 100.0, "maxHistoryCap": 1000.0, "resetTime": 0, "warningThreshold": 90 }}Delete and verify
Section titled “Delete and verify”Delete the resource and confirm it no longer appears in the list:
az monitor app-insights component delete \ --app my-app-insights \ --resource-group rg-insights-demoFeatures
Section titled “Features”- Component lifecycle: Create, read, list, and delete Application Insights components.
- Instrumentation key generation: Each component is assigned an instrumentation key returned on creation.
- App ID assignment: Each component is assigned a unique application ID.
- Billing feature configuration: Get and update billing features such as data caps.
- Application type support: Accept
web,other,ios,java,phone,store, andNode.JSapplication types. - Kind field support: Accept
web,ios,phone,store,java, andotherkind values.
Limitations
Section titled “Limitations”- No telemetry ingestion: The Application Insights SDK endpoint (
/v2/track) is not emulated. Telemetry sent from instrumented applications is not stored or queryable. - No Live Metrics stream: The Live Metrics (QuickPulse) endpoint is not emulated.
- No Logs (KQL) queries: Running KQL queries via
az monitor app-insights queryis not supported. - No transaction search: Individual telemetry records are not stored or searchable.
- No availability tests via this resource: Availability tests are managed as a separate
web-testresource type. - No continuous export: Continuous export to Storage is not supported.
Samples
Section titled “Samples”The following sample demonstrates how to use Azure Application Insights with LocalStack for Azure:
API Coverage
Section titled “API Coverage”| Operation ▲ | Implemented ▼ |
|---|