Use Azure Resource Graph with the Azure Resource Health table to get the availability state of Event Hubs namespaces.
Example KQL (for Azure Resource Graph / Log Analytics with HealthResources):
HealthResources
| where type =~ 'microsoft.resourcehealth/availabilitystatuses'
// Keep only Event Hubs namespaces
| where tostring(properties.targetResourceType) =~ 'Microsoft.EventHub/namespaces'
// Extract fields of interest
| extend
NamespaceName = tostring(properties.targetResourceName),
AvailabilityState = tostring(properties.availabilityState)
// Map availability state to a simple health label
| extend HealthStatus = case(
AvailabilityState =~ 'Available', 'Healthy',
AvailabilityState =~ 'Unavailable', 'Unavailable',
AvailabilityState =~ 'Degraded', 'Degraded',
AvailabilityState =~ 'Unknown', 'Unknown',
'Failed')
// Select and sort columns
| project NamespaceName, AvailabilityState, HealthStatus, subscriptionId
| order by NamespaceName asc
Explanation of columns:
-
NamespaceName: Event Hub Namespace name.
-
AvailabilityState: Raw Azure Resource Health state.
-
HealthStatus: Simplified status label (Healthy / Unavailable / Failed/Degraded/Unknown).
Run this query via Azure Resource Graph (for example with az graph query or Search-AzGraph) or in any Log Analytics context where the HealthResources table is available.
References: