Install & Compatibility
Where this runs
tested against v1.62.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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 3.328s · 240.1MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 16.9s · import 3.085s · 241MB
260MB installed
● package 260MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Pipeline
✓ from azureml.pipeline.core import Pipeline
PipelineData
✓ from azureml.pipeline.core import PipelineData
PipelineParameter
✓ from azureml.pipeline.core import PipelineParameter
This quickstart demonstrates how to define a basic Azure ML Pipeline using `azureml-pipeline-core`. It sets up a mocked workspace for local execution, defines a pipeline parameter, an output, and a `PythonScriptStep`. The pipeline includes a simple script that performs a calculation and saves an output file. Note that `azureml-core` is typically required for full functionality and interaction with an actual Azure ML Workspace.
import os
from azureml.core import Workspace, Experiment, Environment
from azureml.core.runconfig import RunConfiguration
from azureml.pipeline.core import Pipeline, PipelineParameter, PipelineData
from azureml.pipeline.steps import PythonScriptStep
# NOTE: For an actual Azure ML run, ensure you have 'azureml-core' installed
# and configured your workspace (e.g., via 'az login' and 'ws.write_config()').
# This example mocks the Workspace for local execution without live Azure setup.
# --- Mock Workspace for local execution (replace with actual Workspace.from_config() for Azure) ---
try:
# Attempt to load actual workspace if configured
ws = Workspace.from_config()
print(f"Loaded Workspace: {ws.name}")
except Exception:
print("Could not load workspace from config. Using dummy for example execution.")
class MockDatastore:
def __init__(self):
self.name = "workspaceblobstore"
def path(self, path_on_datastore): # Mimics the path() method
return f"azureml://datastores/workspaceblobstore/paths/{path_on_datastore}"
class MockWorkspace:
def __init__(self):
self.name = "mock_ws"
self.resource_group = "mock_rg"
self.subscription_id = "mock_sub_id"
def get_default_datastore(self):
return MockDatastore()
def compute_targets(self):
# Placeholder for compute target; 'local' is used if no cluster
return {"cpu-cluster": None}
ws = MockWorkspace()
# -------------------------------------------------------------------------------------------------
# Define an environment for the pipeline step (for Azure run, use a real curated/custom environment)
myenv = Environment("my-python-env")
myenv.python.user_managed_dependencies = False
myenv.docker.enabled = True
myenv.docker.base_image = "mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210707.v1"
# Create a run configuration for the step
run_config = RunConfiguration()
run_config.environment = myenv
# Define a pipeline parameter
pipeline_param = PipelineParameter(name="input_multiplier", default_value=5)
# Define an output for the step, using PipelineData for intermediate data
output_data = PipelineData(name="multiplied_output", datastore=ws.get_default_datastore())
# Create a dummy Python script for the pipeline step
script_content = """
import argparse
import os
from azureml.core import Run
parser = argparse.ArgumentParser()
parser.add_argument("--input_multiplier", type=int)
parser.add_argument("--output_path", type=str)
args = parser.parse_args()
print(f"Received input_multiplier: {args.input_multiplier}")
# Get the run context
run = Run.get_context() # This works even with a mocked workspace, but won't interact with Azure.
# Create a dummy output directory and file
os.makedirs(args.output_path, exist_ok=True)
result = args.input_multiplier * 10
output_file_path = os.path.join(args.output_path, "result.txt")
with open(output_file_path, "w") as f:
f.write(f"Calculation result: {result}")
print(f"Outputting data to: {output_file_path}")
run.upload_file(name="outputs/result.txt", path_or_stream=output_file_path)
"""
script_file = "my_pipeline_script.py"
with open(script_file, "w") as f:
f.write(script_content)
# Create a PythonScriptStep
step1 = PythonScriptStep(
name="multiply_step",
script_name=script_file,
arguments=[
"--input_multiplier", pipeline_param,
"--output_path", output_data
],
outputs=[output_data],
compute_target=ws.compute_targets().get("cpu-cluster", "local"), # Use 'local' for local execution
runconfig=run_config,
source_directory="."
)
# Create the pipeline
pipeline = Pipeline(workspace=ws, steps=[step1])
print(f"Pipeline '{pipeline.name}' created successfully.")
print("To run this pipeline on Azure, ensure your workspace is configured and uncomment the submission code below.")
# # Example of how to submit the pipeline to Azure (requires actual Workspace & Experiment):
# # experiment = Experiment(ws, "my_pipeline_experiment")
# # pipeline_run = experiment.submit(pipeline, pipeline_parameters={"input_multiplier": 7})
# # pipeline_run.wait_for_completion(show_output=True)
# Clean up the dummy script file
os.remove(script_file)
Debug
Known issues
breakingThis package (`azureml-pipeline-core`) is part of the Azure ML SDK v1. Azure ML SDK v2, introduced with the `azure-ml` package, uses a completely different API and conceptual model (e.g., YAML-based definitions, `MLClient`). Code written for v1 is not compatible with v2.fixDecide whether to use SDK v1 or v2. If migrating to v2, be prepared for a full rewrite of pipeline definitions. For new projects, consider starting with SDK v2 (`pip install azure-ml`) unless specific v1 features are required.
affects: All versions (v1 vs v2 distinction)
gotchaWhile `azureml-pipeline-core` is a standalone package, it is practically unusable without `azureml-core` for interacting with an Azure Machine Learning Workspace, Experiments, and Compute Targets. Many objects (like `Workspace`, `Experiment`, `Environment`, `RunConfiguration`) come from `azureml-core`.fixAlways install `azureml-core` alongside `azureml-pipeline-core` (e.g., `pip install azureml-core azureml-pipeline-core`) and ensure your workspace is properly configured for authentication.
affects: All versions
gotchaThere is a common confusion between `PipelineData` and `DataReference`. `PipelineData` (from `azureml.pipeline.core`) is used for passing intermediate data *between* steps within a pipeline. `DataReference` (from `azureml.data.data_reference`) is used for referencing data already registered as a dataset in your Azure ML Workspace.fixUse `PipelineData` for inputs/outputs that are generated by one step and consumed by another within the same pipeline run. Use `DataReference` when you need to refer to a pre-existing dataset that resides in a datastore or has been registered in the workspace.
affects: All versions
gotchaPipeline steps are highly sensitive to their execution environments. Incorrectly defined `Environment` objects, missing dependencies, or mismatched Python versions within the environment can lead to pipeline step failures that are hard to debug.fixThoroughly test environments locally first. Use curated environments where possible, or define custom environments explicitly with all necessary dependencies listed. Ensure `requirements.txt` or `conda_dependencies.yml` are complete and correctly specified in your `Environment`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azureml.pipeline'
The required Azure ML pipeline packages are not installed in the Python environment where the code is being executed, or a local file named 'azureml.py' is shadowing the actual package.
fixEnsure the necessary SDK packages (e.g., `azureml-core`, `azureml-pipeline-steps`, `azureml-pipeline-core`) are installed via `pip install` in your environment. If running locally, check for and rename any Python script named `azureml.py` to avoid import conflicts.
AuthenticationFailed
The identity used to submit the pipeline (user or service principal) or the compute target itself lacks the necessary Azure RBAC permissions to access required resources like Azure Container Registry, storage accounts, or to perform management operations.
fixVerify that the user, service principal, or managed identity associated with the compute target has the appropriate Azure RBAC roles (e.g., Storage Blob Data Contributor, Contributor) on the workspace, resource group, storage accounts, and Azure Container Registry. Re-authenticate if an expired token is the issue.
The pipeline compute target [your_compute_target_name] is invalid.
The specified compute target for a pipeline step does not exist, is not in a healthy/running state, or is misconfigured (e.g., in a different region than the workspace, or lacks sufficient resources).
fixCheck the compute target's name, region, and status in Azure ML Studio to ensure it is correctly provisioned and available. Confirm it has adequate resources and consider deleting and re-creating the compute target if transient issues persist.
Incompatible/Missing packages found: azureml-automl-core requires azureml-dataprep<X,>=Y but has azureml-dataprep Z
The Python environment used by the pipeline contains conflicting package versions or is missing essential packages, often due to dependency mismatches between different `azureml` components or third-party libraries.
fixExplicitly define a robust `CondaDependencies` or `Environment` object for your pipeline steps, pinning specific and compatible versions for all required packages. For AutoML-related issues, ensure `azureml-train-automl` and `azureml-dataprep` versions are compatible with your SDK version, typically by updating them.
Upgrade
Version history
1.62.0latest on PyPI · released Feb 25, 2026
Audit
Dependencies
azureml-telemetryrequiredRequired for logging and metrics collection within Azure ML pipelines.
msrestrequiredProvides core REST client functionality for interacting with Azure services.
azure-identityrequiredUsed for Azure Active Directory authentication, essential for secure access.