Azure Machine Learning CLI & SDK v2 - Azure Machine Learning (original) (raw)

APPLIES TO: Azure CLI ml extension v2 (current) Python SDK azure-ai-ml v2 (current)

Azure Machine Learning CLI v2 (CLI v2) and Azure Machine Learning Python SDK v2 (SDK v2) introduce a consistency of features and terminology across the interfaces. To create this consistency, the syntax of commands differs, in some cases significantly, from the first versions (v1).

There are no differences in functionality between CLI v2 and SDK v2. The command line-based CLI might be more convenient in CI/CD MLOps types of scenarios, while the SDK might be more convenient for development.

Azure Machine Learning CLI v2 is the latest extension for the Azure CLI. CLI v2 provides commands in the format az ml to create and maintain Machine Learning assets and workflows. The assets or workflows themselves are defined by using a YAML file. The YAML file defines the configuration of the asset or workflow. For example, what is it, and where should it run?

A few examples of CLI v2 commands:

Use cases for CLI v2

CLI v2 is useful in the following scenarios:

Azure Machine Learning Python SDK v2

Azure Machine Learning Python SDK v2 is an updated Python SDK package, which allows users to:

SDK v2 is on par with CLI v2 functionality and is consistent in how assets (nouns) and actions (verbs) are used between SDK and CLI. For example, to list an asset, you can use the list action in both SDK and CLI. You can use the same list action to list a compute, model, environment, and so on.

Use cases for SDK v2

SDK v2 is useful in the following scenarios:

Should I use v1 or v2?

Support for CLI v1 ended on September 30, 2025. Support for SDK v1 will end on June 30, 2026. While your existing workflows using CLI v1 and SDK v1 will continue to operate after the end-of-support date, they could be exposed to security risks or breaking changes in the event of architectural changes in the product. We recommend that you transition to CLI v2 as soon as possible, and SDK v2 before the end of support date.

We encourage you to migrate your code for both CLI and SDK v1 to CLI and SDK v2. For more information, see Upgrade to v2.

CLI v2

Support for Azure Machine Learning CLI v1 ended on September 30, 2025. Your existing workflows using CLI v1 will continue to operate after the end-of-support date. However, they could be exposed to security risks or breaking changes in the event of architectural changes in the product.

We recommend that you transition to the ml, or v2, extension as soon as possible. For more information on the v2 extension, see Upgrade to v2.

SDK v2

Support for the Azure Machine Learning SDK v1 will end on June 30, 2026. You are able to install and use the SDK v1 until that date.

We recommend that you transition to the SDK v2 before June 30, 2026. For more information, see Upgrade to v2.