Registry /
azure / azure-mgmt-resourcehealth
Install & Compatibility
Where this runs
tested against v1.0.0b6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.584s · 43.5MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.8s · import 0.523s · 44MB
42MB installed
● package 42MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ResourceHealthMgmtClient
✓ from azure.mgmt.resourcehealth import ResourceHealthMgmtClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
Required for authenticating with Azure services.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then initialize `ResourceHealthMgmtClient` to list service health events across your subscription. Replace placeholder values like `YOUR_SUBSCRIPTION_ID` and potentially `resource_uri` with your actual Azure resource details. Ensure `AZURE_SUBSCRIPTION_ID` is set as an environment variable or passed explicitly.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.resourcehealth import ResourceHealthMgmtClient
# Set your Azure Subscription ID as an environment variable, e.g., AZURE_SUBSCRIPTION_ID
# For local development, ensure you are logged in via Azure CLI (`az login`)
# or configure environment variables for service principal authentication.
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "YOUR_SUBSCRIPTION_ID")
if subscription_id == "YOUR_SUBSCRIPTION_ID":
raise ValueError("Please set the AZURE_SUBSCRIPTION_ID environment variable or replace the placeholder.")
# Authenticate using DefaultAzureCredential
# This credential provider chain will attempt various authentication methods.
credential = DefaultAzureCredential()
# Create the Resource Health Management Client
resource_health_client = ResourceHealthMgmtClient(
credential=credential,
subscription_id=subscription_id
)
# Example: List service health events in the subscription
print(f"Listing service health events for subscription ID: {subscription_id}")
for event in resource_health_client.events.list_by_subscription_id():
print(f" Event ID: {event.event_id}, Status: {event.impacted_resource_type}, Severity: {event.severity}, Status: {event.status}")
# Example: Get availability status for a specific resource (replace with your resource URI)
# resource_uri = "/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/{resource_provider}/{resource_type}/{resource_name}"
# print(f"\nGetting availability status for resource: {resource_uri}")
# try:
# availability_status = resource_health_client.availability_statuses.get_by_resource(resource_uri=resource_uri)
# print(f" Availability State: {availability_status.availability_state}")
# print(f" Summary: {availability_status.summary}")
# except Exception as e:
# print(f" Could not retrieve availability status: {e}")
Debug
Known issues
breakingStarting with version 1.0.0b6, this package targets only the latest API-Version available on Azure and removes APIs for other API-Versions. If your application relies on a specific, non-latest API-Version, you may need to pin to an older package version.fixReview the API-Version documentation for the specific Resource Health operations you use. If needed, pin your package version to an earlier release (e.g., `azure-mgmt-resourcehealth==1.0.0b5`) or update your code to use the latest API surface.
affects: >=1.0.0b6
gotchaAuthentication with Azure SDKs often relies on `DefaultAzureCredential`, which attempts multiple authentication methods. Common issues arise if required environment variables (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) are not set, or if `az login` (for Azure CLI) is not performed for local development.fixFor local development, run `az login` in your terminal. For service principals, ensure `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` environment variables are correctly configured. Always set `AZURE_SUBSCRIPTION_ID`.
affects: All
gotchaAs a beta package, the API surface (`ResourceHealthMgmtClient` methods, parameter names, model structures) is subject to change without strict backward compatibility between minor beta versions. This is common in `b` releases within the Azure SDK.fixAlways pin to a specific beta version (`==1.0.0b6`) rather than relying on `~=` or `latest` during development to avoid unexpected breakages. Refer to release notes for any new beta versions before upgrading.
affects: All beta versions
deprecatedWhile `azure-mgmt-resourcehealth` is actively maintained, some older `azure-mgmt-*` client libraries have been refactored or deprecated in favor of newer `azure-resourcemanager-*` or specific `azure-mgmt-resource-*` packages. This can cause confusion if you're mixing new and old styles of Azure SDKs for other resource types.fixConsult the Azure SDK for Python documentation for the specific service you are interacting with to ensure you are using the recommended and latest client library.
affects: All `azure-mgmt-*` libraries
Upgrade
Version history
1.0.0b7latest on PyPI · released Jun 2, 2026
Audit
Dependencies
azure-identityrequiredRequired for authentication using DefaultAzureCredential, which is the recommended approach for Azure SDKs.
PythonrequiredRequires Python version 3.8 or higher.