Registry / azure / azure-mgmt-hybridcompute

azure-mgmt-hybridcompute

JSON →
library9.0.0pypypiunverified

The `azure-mgmt-hybridcompute` library is the Microsoft Azure Hybrid Compute Management Client Library for Python. It provides classes and methods to programmatically manage Azure Arc-enabled servers and related resources. The current stable version is 9.0.0, and like other Azure SDKs, it follows an active release cadence with regular updates for new features and bug fixes.

pip install azure-mgmt-hybridcompute azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-HYBRIDC
A
azure-mgmt-hybridcompute
azurepythonv9.0.0
Install
3.8s avg
Import
584ms
Disk
43MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.0.0 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.622s · 44.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.8s · import 0.547s · 45MB
43MB installed
● package 43MB
Code
Verified usage

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

HybridComputeManagementClient
from azure.mgmt.hybridcompute import HybridComputeManagementClient
DefaultAzureCredential
from azure.identity import DefaultAzureCredential
from azure.common.credentials import ServicePrincipalCredentials
Old authentication classes like ServicePrincipalCredentials are deprecated; use azure-identity classes like DefaultAzureCredential instead for unified authentication across environments.

This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list all Azure Arc-enabled machines within a specified subscription. Ensure `AZURE_SUBSCRIPTION_ID` and other necessary Azure authentication environment variables (like `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID` if using a service principal) are set, or that you are logged in via `az login`.

import os from azure.identity import DefaultAzureCredential from azure.mgmt.hybridcompute import HybridComputeManagementClient # Set environment variables for authentication and subscription # AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID for service principal or Azure CLI login # AZURE_SUBSCRIPTION_ID for your Azure subscription 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.") exit(1) try: # Acquire a credential object using DefaultAzureCredential # This credential will attempt to authenticate via multiple mechanisms: # Environment variables, Managed Identity, Azure CLI, Visual Studio Code, etc. credential = DefaultAzureCredential() # Create a Hybrid Compute Management client client = HybridComputeManagementClient(credential=credential, subscription_id=subscription_id) print(f"Listing all machines in subscription {subscription_id}:") # Iterate over machines in the subscription for machine in client.machines.list_by_subscription(): print(f" - Machine Name: {machine.name}, Location: {machine.location}, Status: {machine.status}") except Exception as e: print(f"An error occurred: {e}") print("Ensure you are authenticated to Azure (e.g., via `az login` or environment variables).")
Debug
Known issues
breakingThe credential system has been completely revamped in versions 7.0.0b1 and later. Old authentication classes like `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported. The `credentials` parameter for client constructors has been renamed to `credential`.
fix
Migrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication and update client constructor parameter names. Refer to the Azure SDK for Python authentication documentation.
affects: >=7.0.0b1
breakingLong-running operations (LROs) that previously returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are prefixed with `begin_` (e.g., `create_or_update` becomes `begin_create_or_update`). The `CloudError` exception has been removed, replaced by `azure.core.exceptions.HttpResponseError`.
fix
Update calls to LRO methods to use the `begin_` prefix and handle `HttpResponseError` for API-related exceptions. The `raw` parameter in operation kwargs is also removed; equivalent functionality is available via the `cls` callback.
affects: >=7.0.0b1
breakingVersion 9.0.0 removed the `AgentVersionOperations`, `HybridIdentityMetadataOperations`, `LicenseProfilesOperations`, and `LicensesOperations` operation groups. If your code uses these, it will break.
fix
Review release notes for alternatives or changes in how these functionalities are accessed. It's possible the functionality was integrated into other operations or removed if deprecated upstream.
affects: 9.0.0
gotchaSupport for Python 2.7 has officially ended on January 1, 2022. This library, like all new Azure SDK for Python packages, requires Python 3.8 or later.
fix
Upgrade your Python environment to Python 3.8 or a newer supported version.
affects: <=9.0.0
gotchaSome users have reported discrepancies where certain Hybrid Compute API operations documented in the REST API were initially missing or delayed in the Python SDK. While efforts are made to keep SDKs up-to-date, occasional gaps or delays in API parity can occur.
fix
Always cross-reference with the official Azure SDK for Python documentation and the library's GitHub repository for the latest supported operations. If an operation is missing, check for newer SDK versions or file an issue on the Azure SDK GitHub.
affects: All versions
Upgrade
Version history
9.0.0latest on PyPI · released Oct 14, 2024
Audit
Dependencies
azure-identityrequiredRequired for authenticating with Azure services.
Agent activity
50 hits · last 30 days
node
44
OpenAI (training)
1
Resources
azure-mgmt-hybridcompute — pip install azure-mgmt-hybridcompute · libregistry