Skip to content

Commit a49a24d

Browse files
authored
Merge pull request #263870 from cdpark/refresh-azure-ml
User Story 200534: Q&M: AzureML Freshness updates -- Configure MLflow
2 parents 48c8b8f + 43a1d51 commit a49a24d

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

articles/machine-learning/how-to-use-mlflow-configure-tracking.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
---
22
title: Configure MLflow for Azure Machine Learning
33
titleSuffix: Azure Machine Learning
4-
description: Connect MLflow to Azure Machine Learning workspaces to log metrics, artifacts and deploy models.
4+
description: Connect MLflow to Azure Machine Learning workspaces to log metrics, artifacts, and deploy models.
55
services: machine-learning
66
author: santiagxf
77
ms.author: fasantia
88
ms.reviewer: mopeakande
99
ms.service: machine-learning
1010
ms.subservice: mlops
11-
ms.date: 11/04/2022
11+
ms.date: 01/19/2024
1212
ms.topic: how-to
1313
ms.custom: mlflow, cliv2, devplatv2, event-tier1-build-2022
1414
ms.devlang: azurecli
1515
---
1616

17-
1817
# Configure MLflow for Azure Machine Learning
1918

20-
Azure Machine Learning workspaces are MLflow-compatible, which means they can act as an MLflow server without any extra configuration. Each workspace has an MLflow tracking URI that can be used by MLflow to connect to the workspace. Azure Machine Learning workspaces **are already configured to work with MLflow** so no extra configuration is required.
19+
This article explains how you can configure MLflow to connect to an Azure Machine Learning workspace for tracking, registries, and deployment.
20+
21+
Azure Machine Learning workspaces are MLflow-compatible, which means they can act as an MLflow server without any extra configuration. Each workspace has an MLflow tracking URI that MLflow can use to connect to the workspace. Azure Machine Learning workspaces **are already configured to work with MLflow** so no extra configuration is required.
2122

22-
However, if you are working outside of Azure Machine Learning (like your local machine, Azure Synapse Analytics, or Azure Databricks) you need to configure MLflow to point to the workspace. In this article, you'll learn how you can configure MLflow to connect to an Azure Machine Learning for tracking, registries, and deployment.
23+
However, if you work outside of Azure Machine Learning (like your local machine, Azure Synapse Analytics, or Azure Databricks), you need to configure MLflow to point to the workspace.
2324

2425
> [!IMPORTANT]
25-
> When running on Azure Compute (Azure Machine Learning Notebooks, Jupyter notebooks hosted on Azure Machine Learning Compute Instances, or jobs running on Azure Machine Learning compute clusters) you don't have to configure the tracking URI. **It's automatically configured for you**.
26+
> When running on Azure Compute (Azure Machine Learning Notebooks, Jupyter notebooks hosted on Azure Machine Learning compute instances, or jobs running on Azure Machine Learning compute clusters), you don't have to configure the tracking URI. **It's automatically configured for you**.
2627
2728
## Prerequisites
2829

@@ -39,15 +40,15 @@ To connect MLflow to an Azure Machine Learning workspace, you need the tracking
3940

4041
## Configure authentication
4142

42-
Once the tracking is set, you'll also need to configure how the authentication needs to happen to the associated workspace. By default, the Azure Machine Learning plugin for MLflow will perform interactive authentication by opening the default browser to prompt for credentials.
43+
Once the tracking is set, you also need to configure the authentication method for the associated workspace. By default, the Azure Machine Learning plugin for MLflow performs interactive authentication by opening the default browser to prompt for credentials.
4344

4445
The Azure Machine Learning plugin for MLflow supports several authentication mechanisms through the package `azure-identity`, which is installed as a dependency for the plugin `azureml-mlflow`. The following authentication methods are tried one by one until one of them succeeds:
4546

46-
1. __Environment__: it reads account information specified via environment variables and use it to authenticate.
47-
1. __Managed Identity__: If the application is deployed to an Azure host with Managed Identity enabled, it authenticates with it.
48-
1. __Azure CLI__: if a user has signed in via the Azure CLI `az login` command, it authenticates as that user.
49-
1. __Azure PowerShell__: if a user has signed in via Azure PowerShell's `Connect-AzAccount` command, it authenticates as that user.
50-
1. __Interactive browser__: it interactively authenticates a user via the default browser.
47+
1. __Environment__: Reads account information specified via environment variables and uses it to authenticate.
48+
1. __Managed Identity__: If the application is deployed to an Azure host with Managed Identity enabled, it authenticates with it.
49+
1. __Azure CLI__: If a user signs in via the Azure CLI `az login` command, it authenticates as that user.
50+
1. __Azure PowerShell__: If a user signs in via Azure PowerShell's `Connect-AzAccount` command, it authenticates as that user.
51+
1. __Interactive browser__: Interactively authenticates a user via the default browser.
5152

5253
[!INCLUDE [mlflow-configure-auth](includes/machine-learning-mlflow-configure-auth.md)]
5354

@@ -56,20 +57,20 @@ If you'd rather use a certificate instead of a secret, you can configure the env
5657

5758
### Configure authorization and permission levels
5859

59-
Some default roles like [AzureML Data Scientist or contributor](how-to-assign-roles.md#default-roles) are already configured to perform MLflow operations in an Azure Machine Learning workspace. If using a custom roles, you need the following permissions:
60+
Some [default roles](how-to-assign-roles.md#default-roles) like *AzureML Data Scientist* or *Contributor* are already configured to perform MLflow operations in an Azure Machine Learning workspace. If using a custom role, you need the following permissions:
6061

6162
* **To use MLflow tracking:**
62-
* `Microsoft.MachineLearningServices/workspaces/experiments/*`.
63-
* `Microsoft.MachineLearningServices/workspaces/jobs/*`.
63+
* `Microsoft.MachineLearningServices/workspaces/experiments/*`
64+
* `Microsoft.MachineLearningServices/workspaces/jobs/*`
6465

6566
* **To use MLflow model registry:**
6667
* `Microsoft.MachineLearningServices/workspaces/models/*/*`
6768

68-
Grant access for the service principal you created or user account to your workspace as explained at [Grant access](../role-based-access-control/quickstart-assign-role-user-portal.md#grant-access).
69+
To learn how to grant access for the service principal you created or user account to your workspace, see [Grant access](../role-based-access-control/quickstart-assign-role-user-portal.md#grant-access).
6970

7071
### Troubleshooting authentication
7172

72-
MLflow will try to authenticate to Azure Machine Learning on the first operation interacting with the service, like `mlflow.set_experiment()` or `mlflow.start_run()`. If you find issues or unexpected authentication prompts during the process, you can increase the logging level to get more details about the error:
73+
MLflow tries to authenticate to Azure Machine Learning on the first operation that interacts with the service, like `mlflow.set_experiment()` or `mlflow.start_run()`. If you find issues or unexpected authentication prompts during the process, you can increase the logging level to get more details about the error:
7374

7475
```python
7576
import logging
@@ -87,7 +88,7 @@ All MLflow runs are logged to the active experiment. By default, runs are logged
8788

8889
# [MLflow SDK](#tab/mlflow)
8990

90-
To configure the experiment you want to work on use MLflow command [`mlflow.set_experiment()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_experiment).
91+
Configure your experiment by using MLflow command [`mlflow.set_experiment()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_experiment).
9192

9293
```Python
9394
experiment_name = 'experiment_with_mlflow'
@@ -104,9 +105,9 @@ export MLFLOW_EXPERIMENT_NAME="experiment_with_mlflow"
104105

105106
---
106107

107-
## Non-public Azure Clouds support
108+
## Nonpublic Azure Clouds support
108109

109-
The Azure Machine Learning plugin for MLflow is configured by default to work with the global Azure cloud. However, you can configure the Azure cloud you are using by setting the environment variable `AZUREML_CURRENT_CLOUD`.
110+
The Azure Machine Learning plugin for MLflow is configured by default to work with the global Azure cloud. However, you can configure the Azure cloud you're using by setting the environment variable `AZUREML_CURRENT_CLOUD`.
110111

111112
# [MLflow SDK](#tab/mlflow)
112113

@@ -124,7 +125,7 @@ export AZUREML_CURRENT_CLOUD="AzureChinaCloud"
124125

125126
---
126127

127-
You can identify the cloud you are using with the following Azure CLI command:
128+
You can identify the cloud you're using with the following Azure CLI command:
128129

129130
```bash
130131
az cloud list
@@ -137,6 +138,6 @@ The current cloud has the value `IsActive` set to `True`.
137138
Now that your environment is connected to your workspace in Azure Machine Learning, you can start to work with it.
138139

139140
- [Track ML experiments and models with MLflow](how-to-use-mlflow-cli-runs.md)
140-
- [Manage models registries in Azure Machine Learning with MLflow]()
141+
- [Manage models registries in Azure Machine Learning with MLflow](how-to-manage-models-mlflow.md)
141142
- [Train with MLflow Projects (Preview)](how-to-train-mlflow-projects.md)
142143
- [Guidelines for deploying MLflow models](how-to-deploy-mlflow-models.md)

0 commit comments

Comments
 (0)