CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-mgmt-machinelearningcompute

Microsoft Azure Machine Learning Compute Management Client Library for Python

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

client-management.mddocs/

Client Management

Core client initialization, configuration, and authentication for accessing Azure Machine Learning Compute resources. This module provides the main entry point and configuration management for the SDK.

Capabilities

Management Client

The primary client class that coordinates all Azure Machine Learning Compute operations. Provides access to specialized operation groups and handles authentication, serialization, and service communication.

class MachineLearningComputeManagementClient:
    """
    Main client for Azure Machine Learning Compute management operations.
    
    Args:
        credentials: Azure credentials object (from azure.identity)
        subscription_id (str): The Azure subscription ID
        base_url (str, optional): Service URL, defaults to Azure management endpoint
    
    Attributes:
        operationalization_clusters: OperationalizationClustersOperations instance
        machine_learning_compute: MachineLearningComputeOperations instance
        config: Client configuration object
        api_version: "2017-08-01-preview"
    """
    def __init__(self, credentials, subscription_id: str, base_url: str = None): ...
    
    # Properties
    operationalization_clusters: OperationalizationClustersOperations
    machine_learning_compute: MachineLearningComputeOperations
    config: MachineLearningComputeManagementClientConfiguration
    api_version: str

Usage Example:

from azure.identity import DefaultAzureCredential
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClient

# Using DefaultAzureCredential (recommended)
credential = DefaultAzureCredential()
client = MachineLearningComputeManagementClient(
    credentials=credential,
    subscription_id="12345678-1234-5678-9012-123456789012"
)

# Using custom base URL
client = MachineLearningComputeManagementClient(
    credentials=credential,
    subscription_id="12345678-1234-5678-9012-123456789012",
    base_url="https://management.azure.com"
)

# Access operation groups
clusters_ops = client.operationalization_clusters
compute_ops = client.machine_learning_compute

Client Configuration

Configuration class that manages client settings, authentication, and service endpoints. Handles user agent strings, request timeouts, and Azure-specific configuration.

class MachineLearningComputeManagementClientConfiguration:
    """
    Configuration for MachineLearningComputeManagementClient.
    
    Args:
        credentials: Azure credentials object
        subscription_id (str): The Azure subscription ID
        base_url (str, optional): Service URL, defaults to Azure management endpoint
    
    Attributes:
        credentials: Stored credentials for authentication
        subscription_id: Azure subscription identifier
        generate_client_request_id: Whether to generate request IDs
        accept_language: Accept-Language header value
        long_running_operation_timeout: Timeout for long-running operations
    """
    def __init__(self, credentials, subscription_id: str, base_url: str = None): ...
    
    # Configuration properties
    credentials: object
    subscription_id: str
    generate_client_request_id: bool
    accept_language: str
    long_running_operation_timeout: int
    
    def add_user_agent(self, value: str) -> None:
        """Add custom user agent string."""

Usage Example:

from azure.identity import DefaultAzureCredential
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClientConfiguration

# Direct configuration usage (rarely needed)
credential = DefaultAzureCredential()
config = MachineLearningComputeManagementClientConfiguration(
    credentials=credential,
    subscription_id="12345678-1234-5678-9012-123456789012"
)

# Access configuration properties
print(f"Subscription: {config.subscription_id}")
print(f"User agent includes: azure-mgmt-machinelearningcompute/0.4.1")

# Modify timeout for long-running operations
config.long_running_operation_timeout = 600  # 10 minutes

Authentication Patterns

Using DefaultAzureCredential (Recommended)

from azure.identity import DefaultAzureCredential
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClient

# Automatically uses environment variables, managed identity, or interactive auth
credential = DefaultAzureCredential()
client = MachineLearningComputeManagementClient(credential, subscription_id)

Using Service Principal

from azure.identity import ClientSecretCredential
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClient

credential = ClientSecretCredential(
    tenant_id="tenant-id",
    client_id="client-id", 
    client_secret="client-secret"
)
client = MachineLearningComputeManagementClient(credential, subscription_id)

Using Interactive Authentication

from azure.identity import InteractiveBrowserCredential
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClient

credential = InteractiveBrowserCredential()
client = MachineLearningComputeManagementClient(credential, subscription_id)

Error Handling

The client raises exceptions for authentication failures, invalid parameters, and service errors:

from azure.mgmt.machinelearningcompute.models import ErrorResponseWrapperException
from azure.core.exceptions import ClientAuthenticationError

try:
    cluster = client.operationalization_clusters.get("rg", "cluster")
except ClientAuthenticationError:
    print("Authentication failed - check credentials")
except ErrorResponseWrapperException as e:
    print(f"Service error: {e.message}")
except Exception as e:
    print(f"Unexpected error: {e}")

Install with Tessl CLI

npx tessl i tessl/pypi-azure-mgmt-machinelearningcompute

docs

client-management.md

cluster-operations.md

index.md

models-types.md

system-operations.md

tile.json