How to use Azure Resource Graph Explorer for Microsoft.Web resources

Azure Resource Graph

Azure Resource Graph is an Azure service designed to extend Azure Resource Management by providing efficient and performant resource exploration with the ability to query at scale across a given set of subscriptions so that you can effectively govern your environment.

Below are few Microsoft.web resource types supported by Azure Resource Graph:

  • microsoft.web/apimanagementaccounts
  • microsoft.web/apimanagementaccounts/apis
  • microsoft.web/certificates
  • Microsoft.Web/connectionGateways (On-premises Data Gateways)
  • Microsoft.Web/connections (API Connections)
  • Microsoft.Web/customApis (Logic Apps Custom Connector)
  • Microsoft.Web/HostingEnvironments (App Service Environments)
  • Microsoft.Web/KubeEnvironments (App Service Kubernetes Environments)
  • Microsoft.Web/serverFarms (App Service plans)
  • Microsoft.Web/sites (App Services)
  • microsoft.web/sites/premieraddons
  • Microsoft.Web/sites/slots (App Service (Slots))
  • Microsoft.Web/StaticSites (Static Web Apps)
  • Microsoft.Web/WorkerApps (Container Apps)

How to Explore Azure Graph Explorer on Azure portal:

Use Resource Graph Explorer for executing the queries

Azure Graph Queries

To see all sites across all subscriptions and resources groups:

1
2
resources
| where type == "microsoft.web/sites"

If you want to see all your sites that are located in West US:

1
2
3
resources
| where type == "microsoft.web/sites"
| where location == "westus"

If you want to see all your running sites, you can drill into the “properties” object:

1
2
3
resources
| where type == "microsoft.web/sites"
| where properties.state == "Running"

To get sites count by region:

1
2
3
resources
| where type == "microsoft.web/sites"
| summarize count() by location

All function apps were using Python 3.6
Filter on app settings of a site by filtering on properties.siteProperties.properties

1
2
3
4
resources
| where type == 'microsoft.web/sites'
| where subscriptionId =~ '<SubIdHere>'
| where properties.siteProperties.properties contains "Python|3.6"