How to write kusto query to display resource type like in Azure

206 views Asked by At

When I go to the Azure portal to display the resources in the resource group, the list of types would look like: enter image description here

I ran the following Kusto query in the Azure Resource Graph Explorer to obtain the resources in the subscription:

| join kind=inner (
    resourcecontainers
    | where type == 'microsoft.resources/subscriptions'
) on $left.subscriptionId == $right.subscriptionId
| project id, name, type, location, resourceGroup, name1
| where resourceGroup == 'wp-production-dynamicsnavaddons'
| order by name asc

The results will display the type as (these were exported into a CSV file):

enter image description here

I can assume that the value of "microsoft.web/sites" from Kusto is "App Service" in the portal. But we have a lot of resources in Azure and I don't want to match them 1 by 1. I was wondering is there a way in Kusto Query to display the Type like what's in the portal? (display "App Service" instead of "microsoft.web/sites").

Jason

1

There are 1 answers

1
bursson On BEST ANSWER

Just turn on the "Formatted results" in Azure Resource Graph Explorer. This will format the results both in browser and in the exported CSV-file.

In the portal: Azure Resource Explorer screenshot

And in the exported CSV:

"NAME","TYPE","LOCATION","RESOURCE GROUP","NAME1"
"Failure Anomalies - devenvpocfunc","Smart detector alert rule","Global","gammaray-devenvpoc3","Visual Studio Professional Subscription"
"devenvpocfunc","Application Insights","West Europe","gammaray-devenvpoc3","Visual Studio Professional Subscription"
"devenvpocfunc","Storage account","West Europe","gammaray-devenvpoc3","Visual Studio Professional Subscription"
"devenvpocfunc","App Service plan","West Europe","gammaray-devenvpoc3","Visual Studio Professional Subscription"
"devenvpocfunc","App Service","West Europe","gammaray-devenvpoc3","Visual Studio Professional Subscription"