MLflow and Azure Machine Learning

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

This article describes the capabilities of MLflow, an open-source framework designed to manage the complete machine learning lifecycle. MLflow uses a consistent set of tools to train and serve models on different platforms. You can use MLflow whether your experiments are running locally or on a remote compute target, virtual machine, or Azure Machine Learning compute instance.

Azure Machine Learning workspaces are MLflow-compatible, which means that you can use an Azure Machine Learning workspace the same way you use an MLflow server. This compatibility has the following advantages:

  • Azure Machine Learning doesn't host MLflow server instances, but can use the MLflow APIs directly.
  • You can use an Azure Machine Learning workspace as your tracking server for any MLflow code, whether or not it runs in Azure Machine Learning. You only need to configure MLflow to point to the workspace where the tracking should occur.
  • You can run any training routine that uses MLflow in Azure Machine Learning without making any changes.

Tip

Unlike the Azure Machine Learning SDK v1, there's no logging functionality in the Azure Machine Learning v2 SDK. You can use MLflow logging to ensure that your training routines are cloud-agnostic, portable, and have no dependency on Azure Machine Learning.

Tracking with MLflow

Azure Machine Learning uses MLflow tracking to log metrics and store artifacts for your experiments. When you're connected to Azure Machine Learning, all MLflow tracking materializes in the workspace you're working in.

To learn how to set up MLflow tracking for experiments and training routines, see Log metrics, parameters, and files with MLflow. You can also query and compare experiments and runs with MLflow.

MLflow in Azure Machine Learning provides a way to centralize tracking. You can connect MLflow to Azure Machine Learning workspaces even when you're working locally or in a different cloud. The Azure Machine Learning workspace provides a centralized, secure, and scalable location to store training metrics and models.

MLflow in Azure Machine Learning can:

Tracking with MLflow in R

MLflow support in R has the following limitations:

  • MLflow tracking is limited to tracking experiment metrics, parameters, and models on Azure Machine Learning jobs.
  • Interactive training on RStudio, Posit (formerly RStudio Workbench), or Jupyter notebooks with R kernels isn't supported.
  • Model management and registration aren't supported. Use the Azure Machine Learning CLI or Azure Machine Learning studio for model registration and management.

For examples of using the MLflow tracking client with R models in Azure Machine Learning, see Train R models using the Azure Machine Learning CLI (v2).

Tracking with MLflow in Java

MLflow support in Java has the following limitations:

  • MLflow tracking is limited to tracking experiment metrics and parameters on Azure Machine Learning jobs.
  • Artifacts and models can't be tracked. Instead, use the mlflow.save_model method with the outputs folder in jobs to save models or artifacts that you want to capture.

For a Java example that uses the MLflow tracking client with the Azure Machine Learning tracking server, see azuremlflow-java.

Example notebooks for MLflow tracking

Model registration with MLflow

Azure Machine Learning supports MLflow for model management. This support is a convenient way for users who are familiar with the MLflow client to manage the entire model lifecycle. For more information about how to manage models by using the MLflow API in Azure Machine Learning, see Manage model registries in Azure Machine Learning with MLflow.

Example notebook for MLflow model registration

Model management with MLflow demonstrates how to manage models in registries.

Model deployment with MLflow

You can deploy MLflow models to Azure Machine Learning to take advantage of an improved experience. Azure Machine Learning supports deployment of MLflow models to both real-time and batch endpoints without having to specify an environment or a scoring script.

The MLflow SDK, Azure Machine Learning CLI, Azure Machine Learning SDK for Python, and Azure Machine Learning studio all support MLflow model deployment. For more information about deploying MLflow models to Azure Machine Learning for both real-time and batch inferencing, see Guidelines for deploying MLflow models.

Example notebooks for MLflow model deployment

Training with MLflow Projects (preview)

Warning

Support for MLproject files (MLflow Projects) in Azure Machine Learning will be fully retired in September 2026. MLflow is still fully supported and is still the recommended way to track machine learning workloads in Azure Machine Learning.

As you continue to use MLflow, we recommend that you transition from MLproject files to Azure Machine Learning Jobs, using either the Azure CLI or the Azure Machine Learning SDK for Python (v2). For more information on Azure Machine Learning jobs, see Track ML experiments and models with MLflow.

Important

This feature is currently in public preview. This preview version is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities.

For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

You can submit training jobs to Azure Machine Learning by using MLflow Projects. You can submit jobs locally with Azure Machine Learning tracking or migrate your jobs to the cloud via Azure Machine Learning compute.

To learn how to submit training jobs that use MLflow Projects to Azure Machine Learning workspaces for tracking, see Train with MLflow Projects in Azure Machine Learning (preview).

Example notebooks for MLflow Projects

MLflow vs Azure Machine Learning client tools capabilities

The following table shows machine learning lifecycle operations that are possible with the MLflow SDK and the Azure Machine Learning client tools.

Feature MLflow SDK Azure Machine Learning CLI/SDK v2 Azure Machine Learning studio
Track and log metrics, parameters, and models
Retrieve metrics, parameters, and models Only artifacts and models can be downloaded.
Submit training jobs Possible by using MLflow Projects (preview).
Submit training jobs with Azure Machine Learning data assets
Submit training jobs with machine learning pipelines
Manage experiments and runs
Manage MLflow models Some operations might not be supported.1
Manage non-MLflow models
Deploy MLflow models to Azure Machine Learning (online and batch) Deploying MLflow models for batch inference isn't currently supported.2
Deploy non-MLflow models to Azure Machine Learning

1 For more information, see Manage model registries in Azure Machine Learning with MLflow.

2 For an alternative, see Deploy and run MLflow models in Spark jobs.