Watch a web app with Application Insights

Azure Portal, Hands On15 minutesFree tierSteps checked 25 October 2026By Cloud Hands On

In this task you'll monitor a web app with Application Insights.

Application Insights watches an application from the inside: every request, how long it took, which ones failed, and the errors behind them. It's part of Azure Monitor, and it stores its data in a Log Analytics workspace.

For App Service and Functions you can switch it on from the app's own page, often without changing any code. It then fills ready-made views such as Live metrics, Failures, Performance and Application map.

Example. SS Kaiser's checkout felt slow on Saturday mornings. Application Insights' Performance view showed one page waiting four seconds for a stock check, and the team fixed that call first.

Before you start

You need: Contributor on the resource group. Time: 15 minutes.

Where to look

  1. App Services
  2. app-practice
  3. Monitoring
  4. Application Insights

Steps

  1. Create the free web app from the Create a web app on the free tier task if you don't have it. Open it and select Application Insights under Monitoring.
  2. Set Application Insights to Enable. Under Change your resource, choose to create a new resource named appi-practice in the same region, and let it use a new or existing Log Analytics workspace. Select Apply, then Yes.The app restarts to pick up the setting. For a Node.js app on Linux, the page says Node.js options aren't available in the portal: that only means the extra settings. Requests are still collected.
  3. Open the web app's address and refresh it a few times, then add /missing to the address to make a page-not-found error.
  4. Open appi-practice (the View Application Insights data link) and select Live metrics while you refresh the site again. You'll see requests arrive within seconds.
  5. After a few minutes, open Failures to find the 404 requests, then Performance to see the slowest pages.Data other than Live metrics can take 2 to 5 minutes to appear.
  6. Open Logs and run requests | take 10 to see the raw data behind the views.

Commands

# Create Application Insights linked to a Log Analytics workspace
az monitor app-insights component create --resource-group rg-portal-practice --app appi-practice \
  --location uksouth --workspace <workspace resource ID>

# Connect a web app to it
CONN=$(az monitor app-insights component show --resource-group rg-portal-practice --app appi-practice --query connectionString --output tsv)
az webapp config appsettings set --resource-group rg-portal-practice --name <app name> \
  --settings APPLICATIONINSIGHTS_CONNECTION_STRING="$CONN"

Watch out for

Cost
Charged by the GB of data stored in the workspace, after a monthly free allowance. A practice site stays well inside it. Busy sites should use sampling and a daily cap.
Security
Application Insights can record page addresses and error messages, so keep personal data out of URLs and logs.
Common mistakes
Expecting data straight away (apart from Live metrics). Leaving Application Insights collecting everything on a busy site, with no daily cap. Creating it in a different region from the app.

Clean up

  1. Resource groups
  2. rg-portal-practice
  3. Delete resource group

Delete appi-practice and any workspace you made for it, or delete the resource group.

Words to know

Application Insights
Application performance monitoring in Azure Monitor: requests, failures, dependencies and traces.
Live metrics
A near real-time view of requests, failures and servers, while you watch.
Dependency
A call your app makes to something else, such as a database or an API.
Availability test
A check from Azure's servers that your site answers, run every few minutes.

Tick off each step and track your progress in the guide.

Open this task in Azure Portal, Hands On

Keep going