Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi @Selvam Sekar ,
Thank you for reaching us regarding the issue.
Yes, the Azure App Service CPU Percentage metric is available in Azure Monitor Logs / Log Analytics (in the AzureMetrics table), provided you configure diagnostic settings to export it.
Supported Metrics for App Service Plans (Microsoft.Web/serverfarms):
- Metric Display Name: CPU Percentage
- Name in REST API: CpuPercentage
- Unit: Percent
- Aggregation: Average (primarily)
- Dimensions: Instance
- DS Export: Yes (exportable to Azure Monitor Logs via Diagnostic Settings)
- Description: “The average CPU used across all instances of the plan.”
Note on Web Apps (Microsoft.Web/sites): CpuPercentage is available only for Flex Consumption Function Apps. For standard Web Apps, the equivalent per-instance metric is CPU Time (CpuTime), which is also exportable to logs.
Log Table
- Table Name: AzureMetrics (platform metrics exported via Diagnostic Settings land here).
AzureMetrics | where ResourceProvider == "MICROSOFT.WEB" and MetricName == "CpuPercentage" and TimeGenerated > ago(1d) | summarize AvgCPU = avg(Average) by bin(TimeGenerated, 5m), Resource, Instance | render timechart - Per Worker Instance: Yes , via the Instance dimension (exactly as shown when you apply splitting in the Azure Portal Metrics UI).
- App Service Plan Level: Yes , aggregated across all instances.
How to Enable
- Go to your App Service Plan (or App Service) > Diagnostic settings > + Add diagnostic setting.
- Select AllMetrics (or specific metrics) > Route to your Log Analytics workspace.
- Save. Data typically appears within a few minutes.
This is the same data source used by the Portal Metrics UI when diagnostics are enabled. Your screenshot shows CPU Time (CpuTime), which follows the same pattern and is also in AzureMetrics.
Reference:
https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-web-serverfarms-metrics
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/create-diagnostic-settings
https://learn.microsoft.com/en-us/azure/app-service/monitor-app-service
Kindly let us know if the above helps or you need further assistance on this issue.
Please "accept" if the information helped you. This will help us and others in the community as well.