Azure Machine Learning Compute Management

0.4.1 · abandoned · verified Sat Apr 11

The Microsoft Azure Machine Learning Compute Management Client Library for Python provides programmatic access to manage compute resources for Azure Machine Learning. It is a very old version (0.4.1) released in early 2019 and is considered abandoned, with its functionality largely superseded by newer Azure Machine Learning SDKs and resource management interfaces.

Warnings

Install

Imports

Quickstart

Demonstrates instantiating the `MachineLearningComputeManagementClient` using `ServicePrincipalCredentials`, which was common for this library's era. It then attempts to list available management operations. Note that this library manages 'Operationalization Clusters', a concept largely deprecated in modern Azure Machine Learning. Running this example successfully may require a legacy Azure environment and careful credential setup.

import os
from msrestazure.azure_active_directory import ServicePrincipalCredentials
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClient

# This library is very old and typically requires legacy authentication methods like Service Principal.
# Ensure AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_SUBSCRIPTION_ID are set.

tenant_id = os.environ.get("AZURE_TENANT_ID", "")
client_id = os.environ.get("AZURE_CLIENT_ID", "")
client_secret = os.environ.get("AZURE_CLIENT_SECRET", "")
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "")

if not all([tenant_id, client_id, client_secret, subscription_id]):
    print("Please set AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_SUBSCRIPTION_ID environment variables.")
    print("This library uses legacy authentication that may not integrate with modern Azure Identity methods.")
else:
    try:
        credentials = ServicePrincipalCredentials(
            client_id=client_id,
            secret=client_secret,
            tenant=tenant_id
        )
        client = MachineLearningComputeManagementClient(credentials, subscription_id)

        print("Attempting to list available operations (might fail if resources are deprecated)...")
        operations = list(client.operations.list())
        if operations:
            print(f"Found {len(operations)} operations. First one: {operations[0].name}")
        else:
            print("No operations found or unable to list.")

    except Exception as e:
        print(f"An error occurred: {e}")
        print("This library is abandoned and its operations may no longer be functional or supported.")

view raw JSON →