How to Configure and Monitor Metrics in Azure App Service — Step-by-Step
Azure App Service automatically collects platform metrics such as CPU Time, Memory Working Set, Requests, HTTP 5xx Errors, and Average Response Time.
You don't need to install any monitoring agent to view these basic metrics.
In this practical exercise, we'll learn how to:
-
View App Service metrics in Azure Portal.
-
Configure Aggregation (Average, Maximum, Total).
-
Configure Time Granularity (1 minute, 5 minutes, etc.).
-
Apply Dimensions using filters and splitting.
-
Create a dashboard chart.
-
Configure a metric alert.
Step 1: Open Your Azure App Service
-
Sign in to Azure Portal.
-
Search for App Services.
-
Select your existing App Service.
-
Open the App Service Overview page.
For example, assume your App Service is named my-portfolio-app.
Step 2: Open Metrics
From your App Service:
-
In the left navigation menu, locate Monitoring.
-
Click Metrics.
-
Azure Metrics Explorer will open.
-
Your App Service should be selected as the scope.
Menu labels may vary slightly depending on the Azure Portal experience.
Step 3: Select a Metric
In Metrics Explorer, configure:
|
Setting |
Select |
|---|---|
|
Scope |
Your App Service |
|
Metric Namespace |
App Service standard metrics |
|
Metric |
Requests |
|
Aggregation |
Sum |
|
Time Range |
Last 30 minutes |
|
Time Granularity |
1 minute |
This displays how many HTTP requests your App Service received in each one-minute interval.
Example: If 100 requests arrive in one minute, the chart shows 100 requests for that interval.
Step 4: Configure Aggregation
Select the Requests metric and change the aggregation.
|
Aggregation |
Result |
|---|---|
|
Sum (Total) |
Total requests during each interval |
|
Average |
Average of recorded values, where supported |
|
Maximum |
Highest recorded value, where supported |
For the Requests metric, Sum (Total) is the appropriate aggregation.
For response-time monitoring, select Response Time and use Average.
Step 5: Configure Time Granularity
At the top of Metrics Explorer:
-
Click the time range selector.
-
Choose Last 30 minutes.
-
Set Time Granularity = 5 minutes.
-
Click Apply.
For example, suppose your App Service receives these requests:
|
Time Interval |
Requests |
|---|---|
|
10:00–10:05 |
100 |
|
10:05–10:10 |
200 |
|
10:10–10:15 |
150 |
|
10:15–10:20 |
300 |
Illustrative data, not actual Azure measurements.
Each point represents the total requests in a five-minute interval.
Step 6: Configure Dimensions
Azure App Service standard metrics commonly support the Instance dimension. This allows you to monitor individual App Service instances when your application is scaled out.
-
In Metrics Explorer, select Requests.
-
Click Apply splitting.
-
Choose the Instance dimension.
-
Select the available instance values.
-
Apply the selection.
For example, if your App Service runs on two instances:
|
Instance |
Requests |
|---|---|
|
Instance 1 |
600 |
|
Instance 2 |
400 |
The chart will display separate series for each instance.
Important: If your App Service has only one instance, you'll see only one series. App Service standard metrics generally do not provide HTTP status code as a dimension. For status-code analysis, use the separate HTTP 4xx/5xx metrics or Application Insights request metrics, which support a Result code dimension.
Step 7: Monitor Multiple Metrics
Click New chart and add the following metrics.
|
Metric |
Recommended Aggregation |
Purpose |
|---|---|---|
|
Requests |
Sum |
Monitor incoming traffic |
|
Response Time |
Average |
Monitor application response time |
|
Http 5xx |
Sum |
Identify server errors |
|
Memory Working Set |
Average |
Monitor application memory usage |
|
CPU Time |
Sum |
Monitor CPU processing time |
For CPU utilization percentage across the hosting infrastructure, check the App Service Plan → Metrics → CPU Percentage, where supported.
Step 8: Pin the Chart to an Azure Dashboard
-
Configure the chart in Metrics Explorer.
-
Select Pin to dashboard.
-
Choose an existing dashboard or create a new one.
-
Open Dashboard in Azure Portal to view the saved chart.
This is useful for monitoring multiple App Services from a single dashboard.
Step 9: Create a Metric Alert
Let's configure an alert when your App Service generates more than 10 HTTP 500-level errors within 5 minutes.
-
Open your App Service.
-
Select Monitoring → Alerts.
-
Click Create → Alert rule.
-
Under Condition, choose Http 5xx or Http Server Errors.
-
Configure the condition:
|
Setting |
Value |
|---|---|
|
Signal |
Http 5xx |
|
Aggregation |
Total |
|
Operator |
Greater than |
|
Threshold |
10 |
|
Check every |
1 minute |
|
Lookback period |
5 minutes |
-
Under Actions, create or select an Action Group.
-
Configure an email notification.
-
Under Details, provide the alert name
AppService-HTTP500-Alert. -
Select Review + create.
Azure Monitor will evaluate the metric and trigger the alert when the configured condition is met. Alerts can incur additional charges.
Step 10: Test the Metrics
You can test request monitoring using your App Service's URL.
-
Open
https://your-app-name.azurewebsites.net. -
Refresh the page several times.
-
Navigate to different application pages.
-
Return to Metrics Explorer.
-
Select Requests → Sum → 1-minute granularity.
-
Observe the request count.
Metrics may take a few minutes to appear. Background traffic, health checks, and other requests can also contribute to the count.
Final Practical Exercise
Azure App Service Metrics Lab
0 of 6 completed
Official Microsoft documentation: Analyze metrics for an Azure resource.
Next recommended exercise: Configure Application Insights for your ASP.NET Core Web API to monitor individual endpoints, SQL dependencies, failed requests, and application response times.