AZ

azure-ai-ml-py

Python SDK for managing Azure ML resources like workspaces, training jobs, and models.

Install

mkdir -p .claude/skills/azure-ai-ml-py-mk-knight23 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19477" && unzip -o skill.zip -d .claude/skills/azure-ai-ml-py-mk-knight23 && rm skill.zip

Installs to .claude/skills/azure-ai-ml-py-mk-knight23

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Azure Machine Learning SDK v2 for Python. Use for ML workspaces, jobs, models, datasets, compute, and pipelines. Triggers: "azure-ai-ml", "MLClient", "workspace", "model registry", "training jobs", "datasets".
209 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Create and manage Azure ML workspaces
  • Register data assets and folders
  • Manage model registry versions
  • Provision and list compute clusters
  • Execute and monitor training jobs

How it works

The skill uses the Azure Machine Learning SDK v2 for Python to interact with Azure cloud resources via the MLClient class.

Inputs & outputs

You give it
Python script with MLClient configuration
You get back
Azure ML resource status or job execution logs

When to use azure-ai-ml-py

  • Register new data assets in Azure ML
  • Create and list machine learning workspaces
  • Manage training jobs and models

About this skill

Azure Machine Learning SDK v2 for Python

Client library for managing Azure ML resources: workspaces, jobs, models, data, and compute.

Installation

pip install azure-ai-ml

Environment Variables

AZURE_SUBSCRIPTION_ID=<your-subscription-id>
AZURE_RESOURCE_GROUP=<your-resource-group>
AZURE_ML_WORKSPACE_NAME=<your-workspace-name>

Authentication

from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

ml_client = MLClient(
    credential=DefaultAzureCredential(),
    subscription_id=os.environ["AZURE_SUBSCRIPTION_ID"],
    resource_group_name=os.environ["AZURE_RESOURCE_GROUP"],
    workspace_name=os.environ["AZURE_ML_WORKSPACE_NAME"]
)

From Config File

from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

# Uses config.json in current directory or parent
ml_client = MLClient.from_config(
    credential=DefaultAzureCredential()
)

Workspace Management

Create Workspace

from azure.ai.ml.entities import Workspace

ws = Workspace(
    name="my-workspace",
    location="eastus",
    display_name="My Workspace",
    description="ML workspace for experiments",
    tags={"purpose": "demo"}
)

ml_client.workspaces.begin_create(ws).result()

List Workspaces

for ws in ml_client.workspaces.list():
    print(f"{ws.name}: {ws.location}")

Data Assets

Register Data

from azure.ai.ml.entities import Data
from azure.ai.ml.constants import AssetTypes

# Register a file
my_data = Data(
    name="my-dataset",
    version="1",
    path="azureml://datastores/workspaceblobstore/paths/data/train.csv",
    type=AssetTypes.URI_FILE,
    description="Training data"
)

ml_client.data.create_or_update(my_data)

Register Folder

my_data = Data(
    name="my-folder-dataset",
    version="1",
    path="azureml://datastores/workspaceblobstore/paths/data/",
    type=AssetTypes.URI_FOLDER
)

ml_client.data.create_or_update(my_data)

Model Registry

Register Model

from azure.ai.ml.entities import Model
from azure.ai.ml.constants import AssetTypes

model = Model(
    name="my-model",
    version="1",
    path="./model/",
    type=AssetTypes.CUSTOM_MODEL,
    description="My trained model"
)

ml_client.models.create_or_update(model)

List Models

for model in ml_client.models.list(name="my-model"):
    print(f"{model.name} v{model.version}")

Compute

Create Compute Cluster

from azure.ai.ml.entities import AmlCompute

cluster = AmlCompute(
    name="cpu-cluster",
    type="amlcompute",
    size="Standard_DS3_v2",
    min_instances=0,
    max_instances=4,
    idle_time_before_scale_down=120
)

ml_client.compute.begin_create_or_update(cluster).result()

List Compute

for compute in ml_client.compute.list():
    print(f"{compute.name}: {compute.type}")

Jobs

Command Job

from azure.ai.ml import command, Input

job = command(
    code="./src",
    command="python train.py --data ${{inputs.data}} --lr ${{inputs.learning_rate}}",
    inputs={
        "data": Input(type="uri_folder", path="azureml:my-dataset:1"),
        "learning_rate": 0.01
    },
    environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu@latest",
    compute="cpu-cluster",
    display_name="training-job"
)

returned_job = ml_client.jobs.create_or_update(job)
print(f"Job URL: {returned_job.studio_url}")

Monitor Job

ml_client.jobs.stream(returned_job.name)

Pipelines

from azure.ai.ml import dsl, Input, Output
from azure.ai.ml.entities import Pipeline

@dsl.pipeline(
    compute="cpu-cluster",
    description="Training pipeline"
)
def training_pipeline(data_input):
    prep_step = prep_component(data=data_input)
    train_step = train_component(
        data=prep_step.outputs.output_data,
        learning_rate=0.01
    )
    return {"model": train_step.outputs.model}

pipeline = training_pipeline(
    data_input=Input(type="uri_folder", path="azureml:my-dataset:1")
)

pipeline_job = ml_client.jobs.create_or_update(pipeline)

Environments

Create Custom Environment

from azure.ai.ml.entities import Environment

env = Environment(
    name="my-env",
    version="1",
    image="mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04",
    conda_file="./environment.yml"
)

ml_client.environments.create_or_update(env)

Datastores

List Datastores

for ds in ml_client.datastores.list():
    print(f"{ds.name}: {ds.type}")

Get Default Datastore

default_ds = ml_client.datastores.get_default()
print(f"Default: {default_ds.name}")

MLClient Operations

PropertyOperations
workspacescreate, get, list, delete
jobscreate_or_update, get, list, stream, cancel
modelscreate_or_update, get, list, archive
datacreate_or_update, get, list
computebegin_create_or_update, get, list, delete
environmentscreate_or_update, get, list
datastorescreate_or_update, get, list, get_default
componentscreate_or_update, get, list

Best Practices

  1. Use versioning for data, models, and environments
  2. Configure idle scale-down to reduce compute costs
  3. Use environments for reproducible training
  4. Stream job logs to monitor progress
  5. Register models after successful training jobs
  6. Use pipelines for multi-step workflows
  7. Tag resources for organization and cost tracking

Prerequisites

azure-ai-ml packageAzure subscription IDAzure resource groupAzure ML workspace

Limitations

  • Compute clusters must be configured for idle scale-down to manage costs

How it compares

It enables programmatic infrastructure management and pipeline orchestration instead of manual portal configuration.

Compared to similar skills

azure-ai-ml-py side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
azure-ai-ml-py (this skill)04moReviewAdvanced
modal57moReviewIntermediate
azure-mgmt-apicenter-py05moReviewIntermediate
langchain-architecture82moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by mk-knight23

View all by mk-knight23

mixpanel-automation

mk-knight23

Automate Mixpanel tasks via Rube MCP (Composio): events, segmentation, funnels, cohorts, user profiles, JQL queries. Always search tools first for current schemas.

00

content-creator

mk-knight23

Create SEO-optimized marketing content with consistent brand voice. Includes brand voice analyzer, SEO optimizer, content frameworks, and social media templates. Use when writing blog posts, creating social media content, analyzing brand voice, optimizing SEO, planning content calendars, or when use

00

attack-tree-construction

mk-knight23

Build comprehensive attack trees to visualize threat paths. Use when mapping attack scenarios, identifying defense gaps, or communicating security risks to stakeholders.

00

notebooklm

mk-knight23

Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.

00

wcag-audit-patterns

mk-knight23

Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.

00

gcp-cloud-run

mk-knight23

Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven), cold start optimization, and event-driven architecture with Pub/Sub.

00

Search skills

Search the agent skills registry