Hello Yeduguri Geethika ADM
Thank you for posting your query on Microsoft Q&A platform.
You need to retrieve Azure health status across multiple regions and subscriptions for various services (e.g., VMs, Application Gateway, Cosmos DB) showing:
- Number of services up/down per region
- Service IDs
- Instance counts per region
Azure provides two key capabilities to achieve this:
- Inventory Resources Across Regions:
Resources
| where type in~ (
'microsoft.compute/virtualmachines',
'microsoft.network/applicationgateways',
'microsoft.insights/components',
'microsoft.cache/redis',
'microsoft.kusto/clusters',
'microsoft.openai/accounts',
'microsoft.documentdb/databaseaccounts',
'microsoft.databricks/workspaces',
'microsoft.web/sites',
'microsoft.keyvault/vaults',
'microsoft.containerservice/managedclusters',
'microsoft.dbformysql/flexibleservers',
'microsoft.dbforpostgresql/flexibleservers',
'microsoft.operationalinsights/workspaces',
'microsoft.logic/workflows',
'microsoft.machinelearningservices/workspaces',
'microsoft.storage/storageaccounts',
'microsoft.web/serverfarms'
)
This gives service type, region, and instance count across subscriptions.
- Check Health Status:
Resource-level health: Use Azure Resource Health API Endpoint:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/resources?api-version=2024-02-01
This returns availabilityState for each resource (Available, Unavailable, Degraded, Unknown).
Service-level health: Use Azure Service Health
In the portal: Service Health → Service Issues → Impacted Resources
Or programmatically via Events API to check outages and planned maintenance.
- Combine Data:
Join Resource Graph output with Resource Health status:
- Group by Region and Service Type
- Aggregate counts for Healthy vs Unhealthy
- Include Resource IDs for detailed reporting
Automation Options:
Azure CLI:
az graph query for inventory + az resourcehealth show for health
PowerShell:
Get-AzResource + Get-AzResourceHealth
Custom Script:
Use Python or PowerShell to call both APIs and export to CSV/dashboard.
Reference: https://dori-uw-1.kuma-moon.com/en-us/rest/api/resourcehealth/
Thanks,
Suchitra.