This seems like it should be easy, but I can't seem to find the data in my Log Analytics Workspace (LAW) to be able to write a KQL query to get CPU Percentage for an App Service Plan. I realize there is already a chart in the portal with this information,
but I want to do this using KQL because I am combining several pieces of data together to put on an Azure dashboard.
Googling gives me something like this:
AzureMetrics
| where ResourceProvider == "MICROSOFT.WEB" and MetricName == "CPUPercentage"
But that gives me no results for any time period. So either this query is not correct or maybe the data I am looking for is not in LAW? Maybe I have to configure some connection between the App Service Plan and LAW?
After testing in our local environment here is our analysis for checking CPU percentage using KQL
We have enabled the diagnostic settings of the app service plan
And published those logs/metrics to the log analytics workspace using the below query we are able to see the CPU percentage of an app service plan
AzureMetrics | where MetricName == "CpuPercentage"