How to identify the app service error in the Azure Monitor?

Gawaskar 0 Reputation points
2024-11-03T16:02:37.7366667+00:00

How can I identify and troubleshoot errors in my Azure App Service using Azure Monitor? What specific metrics, logs, or alerts should I look for to effectively diagnose issues?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,310 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ashok Gandhi Kotnana 160 Reputation points Microsoft Vendor
    2024-11-04T10:46:25.1766667+00:00

    Hi Gawaskar,

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    I can guide you to identify and troubleshoot errors in Azure App Service with Azure Monitor, you’ll want to focus on critical metrics, logs, that reveal application health and performance issues. Here’s a guide to using Azure Monitor to diagnose issues effectively:

    Key Metrics to Monitor

    Start with these primary metrics to detect and analyze issues:

    • CPU and Memory Usage: High CPU or memory usage can cause performance degradation or crashes, often due to resource-intensive operations or memory leaks.
    • Request Count: A sudden increase could indicate high demand or potential load-related issues, while a sharp drop may indicate downtime or connectivity issues.
    • ·Disk Queue Length: If the app writes data, high queue length can signal disk I/O bottlenecks.

    How to View Metrics:

    • In Azure Monitor > Metrics, select your App Service and configure relevant metrics. Adjust time frames to identify spikes and trends. 

    Reference Screenshot below

    User's image

    • Use log query to view Azure Monitor log

    View AppServiceHTTPLogs with log query

    Now that we've accessed the app, let's view the data associated with HTTP requests, found in the AppServiceHTTPLogs.

    1. Click Logs from the left-hand navigation.
    2. Command: AppServiceHTTPLogs

    User's image

    The AppServiceHTTPLogs query returns all requests in the past 24-hours. The column ScStatus contains the HTTP status. To diagnose the HTTP 500 errors, limit the ScStatus to 500 and run the query, as shown below:

    Command below:

    AppServiceHTTPLogs

    | where ScStatus == 500

    User's image

    References: below Microsoft link has how to implement in step-by-step process

    Tutorial: Troubleshoot with Azure Monitor - Azure App Service | Microsoft Learn

    With these steps, you should be able to identify and troubleshoot errors in Azure App Service with Azure Monitor. Hope this helps!

    Please let us know if you have any further queries. I’m happy to assist you further.    


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.