Monitoring Your App Services

Effective monitoring is crucial for ensuring the health, performance, and availability of your applications hosted on App Services.

Introduction to App Services Monitoring

App Services provides a comprehensive suite of tools and features to monitor your applications. This includes tracking key performance indicators (KPIs), analyzing logs, and setting up alerts for potential issues.

Key Monitoring Features

Viewing Metrics

You can view metrics directly from the Azure portal:

  1. Navigate to your App Service resource in the Azure portal.
  2. In the left-hand menu, under the 'Monitoring' section, select 'Metrics'.
  3. Choose the desired metric, aggregation type, and time range to analyze your application's performance over time.

Commonly Monitored Metrics:

Working with Logs

App Services supports several types of logs:

Accessing Logs:

Logs can be accessed via:

# Example of enabling Application Logging in Azure CLI
az webapp log config --name <your-app-name> --resource-group <your-resource-group> --application-logging on --level Information
            

Alerting

Set up alerts to notify you when certain conditions are met, allowing for rapid response to performance degradation or service outages.

  1. Navigate to your App Service resource.
  2. In the left-hand menu, under 'Monitoring', select 'Activity Log' and then 'Alerts'.
  3. Click '+ Create alert rule'.
  4. Define the scope, conditions (based on metrics or logs), and actions (e.g., email notification, webhook).

Best Practice

Configure alerts for critical metrics like HTTP Server Errors, CPU Time exceeding 80%, and Memory Working Set approaching capacity. Also, set up alerts for application-specific error logging.

Diagnose and Solve Problems

This integrated tool can automatically detect common issues like high CPU usage, memory leaks, and deployment failures. It provides step-by-step guidance and recommendations for resolution.

  1. Navigate to your App Service resource.
  2. In the left-hand menu, under 'Monitoring', select 'Diagnose and solve problems'.
  3. Review the suggested analyses or run custom diagnostics.

Common Diagnostic Categories: