You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-use-mlflow-cli-runs.md
+69-41Lines changed: 69 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,28 +51,43 @@ Tracking using MLflow with Azure Machine Learning lets you store the logged metr
51
51
52
52
### Set up tracking environment
53
53
54
-
To track a run that is not running on Azure Machine Learning compute (from now on referred to as *"local compute"*), you need to point your local compute to the Azure Machine Learning MLflow Tracking URI.
55
-
54
+
To track a run that is not running on Azure Machine Learning compute, you need to point MLflow to the Azure Machine Learning MLflow Tracking URI.
56
55
57
56
> [!NOTE]
58
57
> When running on Azure Compute (Azure Notebooks, Jupyter Notebooks hosted on Azure Compute Instances or Compute Clusters) you don't have to configure the tracking URI. It's automatically configured for you.
59
-
60
-
# [Using the Azure ML SDK v2](#tab/azuremlsdk)
58
+
59
+
1. Getting the Azure Machine Learning Tracking URI:
You can get the Azure ML MLflow tracking URI using the [Azure Machine Learning SDK v2 for Python](concept-v2.md). Ensure you have the library `azure-ai-ml` installed in the cluster you are using. The following sample gets the unique MLFLow tracking URI associated with your workspace. Then the method [`set_tracking_uri()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_tracking_uri) points the MLflow tracking URI to that URI.
82
+
You can get the Azure ML MLflow tracking URI using the [Azure Machine Learning SDK v2 for Python](concept-v2.md). Ensure you have the library `azure-ai-ml` installed in the compute you are using. The following sample gets the unique MLFLow tracking URI associated with your workspace.
65
83
66
-
1.Using the workspace configuration file:
84
+
1.Login into your workspace using the `MLClient`. The easier way to do that is by using the workspace config file:
>`DefaultAzureCredential` will try to pull the credentials from the available context. If you want to specify credentials in a different way, for instance using the web browser in an interactive way, you can use `InteractiveBrowserCredential`orany other method available in`azure.identity` package.
Another option is to set one of the MLflow environment variables [MLFLOW_TRACKING_URI](https://mlflow.org/docs/latest/tracking.html#logging-to-a-tracking-server) directly in your terminal.
124
+
# [Studio](#tab/studio)
112
125
113
-
```Azure CLI
114
-
export MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri | sed 's/"//g')
115
-
```
126
+
Use the Azure Machine Learning portal to get the tracking URI:
116
127
117
-
>[!IMPORTANT]
118
-
> Make sure you are logged in to your Azure account on your local machine, otherwise the tracking URI returns an empty string. If you are using any Azure ML compute the tracking environment and experiment name is already configured.
128
+
1. Open the [Azure Machine Learning studio portal](https://ml.azure.com) and log in using your credentials.
129
+
1. In the upper right corner, click on the name of your workspace to show the __Directory + Subscription + Workspace__ blade.
130
+
1. Click on __View all properties in Azure Portal__.
131
+
1. On the __Essentials__ section, you will find the property __MLflow tracking URI__.
119
132
120
-
# [Building the MLflow tracking URI](#tab/build)
133
+
# [Manually](#tab/manual)
121
134
122
135
The Azure Machine Learning Tracking URI can be constructed using the subscription ID, region of where the resource is deployed, resource group name and workspace name. The following code sample shows how:
123
136
137
+
> [!WARNING]
138
+
> If you are working in a private link-enabled workspace, the MLflow endpoint will also use a private link to communicate with Azure Machine Learning. As a consequence, the tracking URI will look different as proposed here. On those cases, you need to get the tracking URI using the Azure MLSDKorCLI v2.
There are two main ways to configure your environment to work with Azure Machine Learning with Mlflow.
154
+
155
+
# [Using an environment variable](#tab/environ)
126
156
127
-
region=""
128
-
subscription_id=""
129
-
resource_group=""
130
-
workspace_name=""
157
+
You can set the MLflow environment variables [MLFLOW_TRACKING_URI](https://mlflow.org/docs/latest/tracking.html#logging-to-a-tracking-server) in your compute to make any interaction with MLflow in that compute to point by default to Azure Machine Learning.
MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri | sed 's/"//g')
134
161
```
135
162
136
-
> [!WARNING]
137
-
> If you are working in a private link-enabled workspace, the MLflow endpoint will also use a private link to communicate with Azure Machine Learning. As a consequence, the tracking URI will look different as proposed here. On those cases, you need to get the tracking URI using the Azure MLSDKorCLI v2.
163
+
# [Using MLflow SDK](#tab/mlflow)
138
164
139
-
---
165
+
Then the method [`set_tracking_uri()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_tracking_uri) points the MLflow tracking URI to that URI.
140
166
141
-
> [!NOTE]
142
-
> You can also get this URL by:
143
-
>1. Navigate to [Azure ML studio](https://ml.azure.com)
144
-
>2. Click on the upper-right corner of the page -> View all properties in Azure Portal -> MLflow tracking URI.
145
-
>3. Copy the URIand use it with the method `mlflow.set_tracking_uri`.
0 commit comments