Registry / azure / azure-mgmt-hdinsight

azure-mgmt-hdinsight

JSON →
library9.0.1pypypi✓ verified 26d ago

The Microsoft Azure HDInsight Management Client Library for Python provides tools to manage Azure HDInsight clusters, including creation, deletion, scaling, and configuration. It is part of the Azure SDK for Python, currently at version 9.0.0, and typically receives updates aligning with Azure REST API changes and general SDK improvements.

pip install azure-mgmt-hdinsight azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-HDINSIG
A
azure-mgmt-hdinsight
azurepythonv9.0.1
Install
3.8s avg
Import
582ms
Disk
44MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.0.1 · 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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.620s · 44.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.8s · import 0.544s · 45MB
44MB installed
● package 44MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HDInsightManagementClient
from azure.mgmt.hdinsight import HDInsightManagementClient
DefaultAzureCredential
from azure.identity import DefaultAzureCredential
from azure.common.credentials import ServicePrincipalCredentials
DefaultAzureCredential from azure-identity is the modern, recommended authentication method for Azure SDKs.
models
from azure.mgmt.hdinsight.models import Cluster
from azure.mgmt.hdinsight.models import *
It's best practice to import specific models directly for clarity and to avoid namespace pollution.

This quickstart demonstrates how to authenticate with Azure, initialize the `HDInsightManagementClient`, and then list all HDInsight clusters within your subscription, as well as fetch capabilities for a specific location. It uses `DefaultAzureCredential` for flexible authentication.

import os from azure.identity import DefaultAzureCredential from azure.mgmt.hdinsight import HDInsightManagementClient # Set your Azure Subscription ID as an environment variable subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "<your-subscription-id>") if subscription_id == "<your-subscription-id>": print("Please set the AZURE_SUBSCRIPTION_ID environment variable or replace the placeholder.") exit(1) # Authenticate using DefaultAzureCredential, which tries multiple credential types # (environment variables, managed identity, VS Code, Azure CLI, etc.) credential = DefaultAzureCredential() # Create the HDInsight Management Client client = HDInsightManagementClient(credential, subscription_id) print(f"Listing all HDInsight clusters in subscription: {subscription_id}") try: # List all clusters in the subscription clusters = client.clusters.list() found_clusters = False for cluster in clusters: found_clusters = True print(f"- Cluster Name: {cluster.name}, Location: {cluster.location}, State: {cluster.properties.cluster_state}") if not found_clusters: print("No HDInsight clusters found in this subscription.") except Exception as e: print(f"An error occurred: {e}") print("Make sure your AZURE_SUBSCRIPTION_ID is correct and you have appropriate permissions.") print("\nListing available locations (capabilities) for HDInsight:") # Note: list_capabilities often requires a specific location as input for context # We'll use 'eastus' as an example. # This might list an empty set if the subscription has no capabilities in 'eastus' or permission issues. locations = client.locations.list_capabilities("eastus") found_locations = False for location in locations: found_locations = True print(f"- Location: {location.location}, VM Families: {len(location.regions_with_ FVM_families)}, Max Clusters: {location.max_cluster_count}") if found_locations: # Print only the first one for brevity break if not found_locations: print("No capabilities listed for 'eastus' or an error occurred.")
Debug
Known issues
breakingMajor version releases (e.g., 9.0.0) typically introduce breaking changes in API models, client constructors, or method signatures. Always review the migration guide in the official Azure SDK documentation when upgrading between major versions.
fix
Consult the `azure-sdk-for-python` changelog and migration guides on GitHub or docs.microsoft.com for specific changes and updated code examples.
affects: 9.0.0+
gotchaMany Azure management operations, such as creating or deleting clusters, are long-running operations (LROs). The SDK returns a poller object (e.g., `LROPoller`). You must call `.result()` on this poller to wait for the operation to complete and get its final outcome.
fix
After invoking an LRO method (e.g., `client.clusters.begin_create(...)`), store the returned poller object and then call `poller.result()` to ensure the operation finishes before proceeding.
affects: All
deprecatedOlder authentication methods like directly using `ServicePrincipalCredentials` or `TokenCredentials` are being deprecated. The `azure-identity` library with `DefaultAzureCredential` is the recommended and most flexible approach for authentication across Azure SDKs.
fix
Migrate your authentication logic to use `DefaultAzureCredential` from the `azure-identity` library. This allows for seamless authentication across development and production environments.
affects: <9.0.0 (and older versions of `msrestazure`)
gotchaAzure HDInsight management operations are tied to a specific Azure subscription and often a resource group. Ensure you provide the correct `subscription_id` and `resource_group_name` to the client and methods, respectively. Incorrect context will lead to 'ResourceNotFound' or 'PermissionDenied' errors.
fix
Verify that the `subscription_id` used for client initialization is correct and that the authenticated principal has 'Contributor' or equivalent roles on the target subscription/resource group. For resource-group specific operations, ensure the resource group exists and is correctly named.
affects: All
Upgrade
Version history
9.0.1latest on PyPI · released May 18, 2026
Audit
Dependencies
azure-identityrequiredRecommended for Azure Active Directory authentication.
azure-commonrequiredCommon Azure utilities, often a transitive dependency.
msrestazurerequiredCore Azure client runtime for track 1 SDKs.
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
azure-mgmt-hdinsight — pip install azure-mgmt-hdinsight · libregistry