From a2e7071bf7ac1c4727d7f0441070edf2798505f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 10:18:59 +0000 Subject: [PATCH 1/2] Fix MLflow tracking links: add ML Studio URLs and fix tracking URI bug --- .../model-management/model_management.ipynb | 37 ++++++++++++++++- .../keras_mnist_with_mlflow.ipynb | 39 +++++++++++++++++- .../xgboost_classification_mlflow.ipynb | 39 +++++++++++++++++- .../train-and-log/xgboost_nested_runs.ipynb | 37 +++++++++++++++-- .../xgboost_service_principal.ipynb | 41 ++++++++++++++++++- 5 files changed, 183 insertions(+), 10 deletions(-) diff --git a/sdk/python/using-mlflow/model-management/model_management.ipynb b/sdk/python/using-mlflow/model-management/model_management.ipynb index d107a5ae66..525ccd4d99 100644 --- a/sdk/python/using-mlflow/model-management/model_management.ipynb +++ b/sdk/python/using-mlflow/model-management/model_management.ipynb @@ -146,7 +146,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "> To get the URI, please navigate to Azure ML Studio and select the workspace you are working on > Click on the name of the workspace at the upper right corner of the page > Click “View all properties in Azure Portal” on the pane popup > Copy the MLflow tracking URI value from the properties section." + "> **Note:** The MLflow tracking URI is an API endpoint for the Azure Machine Learning tracking server. ", + "Azure Machine Learning does not expose a MLflow UI at this address. ", + "To view your experiments and runs, use [Azure ML Studio](https://ml.azure.com) instead." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> To get the URI, please navigate to Azure ML Studio and select the workspace you are working on > Click on the name of the workspace at the upper right corner of the page > Click \u201cView all properties in Azure Portal\u201d on the pane popup > Copy the MLflow tracking URI value from the properties section." ] }, { @@ -192,6 +201,30 @@ "print(last_run.info.run_id)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "\n", + "# Construct the Azure ML Studio URL to view this run\n", + "tracking_uri = mlflow.get_tracking_uri()\n", + "match = re.search(\n", + " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " tracking_uri,\n", + " re.IGNORECASE,\n", + ")\n", + "if match:\n", + " sub, rg, ws_name = match.groups()\n", + " studio_url = (\n", + " f\"https://ml.azure.com/runs/{last_run.info.run_id}\"\n", + " f\"?wsid=/subscriptions/{sub}/resourcegroups/{rg}/workspaces/{ws_name}\"\n", + " )\n", + " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -626,4 +659,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file diff --git a/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb b/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb index bd3d92ad8a..3fcfb97e48 100644 --- a/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb +++ b/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb @@ -229,6 +229,43 @@ "mlflow.end_run()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **Note:** Azure Machine Learning uses MLflow as a compatible tracking server but does not expose a MLflow UI. ", + "To view your experiments and runs, use [Azure ML Studio](https://ml.azure.com) instead. ", + "You can get the direct link to the run using the code below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "\n", + "# Construct the Azure ML Studio URL to view this run\n", + "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", + "tracking_uri = mlflow.get_tracking_uri()\n", + "match = re.search(\n", + " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " tracking_uri,\n", + " re.IGNORECASE,\n", + ")\n", + "if match:\n", + " sub, rg, ws_name = match.groups()\n", + " studio_url = (\n", + " f\"https://ml.azure.com/runs/{run.info.run_id}\"\n", + " f\"?wsid=/subscriptions/{sub}/resourcegroups/{rg}/workspaces/{ws_name}\"\n", + " )\n", + " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", + "else:\n", + " print(f\"Run ID: {run.info.run_id}\")\n", + " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -526,4 +563,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file diff --git a/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb b/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb index a89584fc9f..f012d8c18e 100644 --- a/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb +++ b/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb @@ -270,6 +270,43 @@ "mlflow.end_run()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **Note:** Azure Machine Learning uses MLflow as a compatible tracking server but does not expose a MLflow UI. ", + "To view your experiments and runs, use [Azure ML Studio](https://ml.azure.com) instead. ", + "You can get the direct link to the run using the code below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "\n", + "# Construct the Azure ML Studio URL to view this run\n", + "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", + "tracking_uri = mlflow.get_tracking_uri()\n", + "match = re.search(\n", + " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " tracking_uri,\n", + " re.IGNORECASE,\n", + ")\n", + "if match:\n", + " sub, rg, ws_name = match.groups()\n", + " studio_url = (\n", + " f\"https://ml.azure.com/runs/{run.info.run_id}\"\n", + " f\"?wsid=/subscriptions/{sub}/resourcegroups/{rg}/workspaces/{ws_name}\"\n", + " )\n", + " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", + "else:\n", + " print(f\"Run ID: {run.info.run_id}\")\n", + " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -698,4 +735,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file diff --git a/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb b/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb index d8e3a951bf..ec776b0af1 100755 --- a/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb +++ b/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb @@ -328,7 +328,7 @@ " \n", " \n", "\n", - "
303 rows × 14 columns
\n", + "303 rows \u00d7 14 columns
\n", "" ], "text/plain": [ @@ -613,7 +613,7 @@ "output_type": "stream", "text": [ "Working in MLflow run: 7eca10a6-d166-4714-a251-10f1585eb101\n", - "100%|███████████████████████████████████████████████████████████████████████████████████| 5/5 [01:05<00:00, 13.15s/trial, best loss: -0.6]\n", + "100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [01:05<00:00, 13.15s/trial, best loss: -0.6]\n", "Showing Histogram of 5 jobs\n" ] }, @@ -651,6 +651,35 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "\n", + "# Construct the Azure ML Studio URL to view the parent run\n", + "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", + "hyperopt_run = mlflow.last_active_run()\n", + "tracking_uri = mlflow.get_tracking_uri()\n", + "match = re.search(\n", + " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " tracking_uri,\n", + " re.IGNORECASE,\n", + ")\n", + "if match:\n", + " sub, rg, ws_name = match.groups()\n", + " studio_url = (\n", + " f\"https://ml.azure.com/runs/{hyperopt_run.info.run_id}\"\n", + " f\"?wsid=/subscriptions/{sub}/resourcegroups/{rg}/workspaces/{ws_name}\"\n", + " )\n", + " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", + "else:\n", + " print(f\"Run ID: {hyperopt_run.info.run_id}\")\n", + " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -848,7 +877,7 @@ " \n", " \n", "\n", - "5 rows × 49 columns
\n", + "5 rows \u00d7 49 columns
\n", "" ], "text/plain": [ @@ -952,4 +981,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file diff --git a/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb b/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb index f4921d5e51..26864bd113 100644 --- a/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb +++ b/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb @@ -153,7 +153,7 @@ "source": [ "import mlflow\n", "\n", - "mlflow.set_tracking_uri = ws.mlflow_tracking_uri\n", + "mlflow.set_tracking_uri(ws.mlflow_tracking_uri)\n", "mlflow.set_experiment(experiment_name=\"heart-condition-classifier\")" ] }, @@ -372,6 +372,43 @@ "mlflow.end_run()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **Note:** Azure Machine Learning uses MLflow as a compatible tracking server but does not expose a MLflow UI. ", + "To view your experiments and runs, use [Azure ML Studio](https://ml.azure.com) instead. ", + "You can get the direct link to the run using the code below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "\n", + "# Construct the Azure ML Studio URL to view this run\n", + "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", + "tracking_uri = mlflow.get_tracking_uri()\n", + "match = re.search(\n", + " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " tracking_uri,\n", + " re.IGNORECASE,\n", + ")\n", + "if match:\n", + " sub, rg, ws_name = match.groups()\n", + " studio_url = (\n", + " f\"https://ml.azure.com/runs/{run.info.run_id}\"\n", + " f\"?wsid=/subscriptions/{sub}/resourcegroups/{rg}/workspaces/{ws_name}\"\n", + " )\n", + " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", + "else:\n", + " print(f\"Run ID: {run.info.run_id}\")\n", + " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -524,4 +561,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file From 906096fac995cba6be7d2c21ba8f626a1e956033 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 10:28:34 +0000 Subject: [PATCH 2/2] Apply black formatting to fix python/validate CI check --- .../model-management/model_management.ipynb | 4 ++-- .../train-and-log/keras_mnist_with_mlflow.ipynb | 6 ++++-- .../xgboost_classification_mlflow.ipynb | 6 ++++-- .../train-and-log/xgboost_nested_runs.ipynb | 12 +++++++----- .../train-and-log/xgboost_service_principal.ipynb | 6 ++++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/sdk/python/using-mlflow/model-management/model_management.ipynb b/sdk/python/using-mlflow/model-management/model_management.ipynb index 525ccd4d99..00a89be98c 100644 --- a/sdk/python/using-mlflow/model-management/model_management.ipynb +++ b/sdk/python/using-mlflow/model-management/model_management.ipynb @@ -155,7 +155,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "> To get the URI, please navigate to Azure ML Studio and select the workspace you are working on > Click on the name of the workspace at the upper right corner of the page > Click \u201cView all properties in Azure Portal\u201d on the pane popup > Copy the MLflow tracking URI value from the properties section." + "> To get the URI, please navigate to Azure ML Studio and select the workspace you are working on > Click on the name of the workspace at the upper right corner of the page > Click “View all properties in Azure Portal” on the pane popup > Copy the MLflow tracking URI value from the properties section." ] }, { @@ -212,7 +212,7 @@ "# Construct the Azure ML Studio URL to view this run\n", "tracking_uri = mlflow.get_tracking_uri()\n", "match = re.search(\n", - " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " r\"subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)\",\n", " tracking_uri,\n", " re.IGNORECASE,\n", ")\n", diff --git a/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb b/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb index 3fcfb97e48..b0064e61e7 100644 --- a/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb +++ b/sdk/python/using-mlflow/train-and-log/keras_mnist_with_mlflow.ipynb @@ -250,7 +250,7 @@ "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", "tracking_uri = mlflow.get_tracking_uri()\n", "match = re.search(\n", - " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " r\"subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)\",\n", " tracking_uri,\n", " re.IGNORECASE,\n", ")\n", @@ -263,7 +263,9 @@ " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", "else:\n", " print(f\"Run ID: {run.info.run_id}\")\n", - " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + " print(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" ] }, { diff --git a/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb b/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb index f012d8c18e..c48e3c69c2 100644 --- a/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb +++ b/sdk/python/using-mlflow/train-and-log/xgboost_classification_mlflow.ipynb @@ -291,7 +291,7 @@ "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", "tracking_uri = mlflow.get_tracking_uri()\n", "match = re.search(\n", - " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " r\"subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)\",\n", " tracking_uri,\n", " re.IGNORECASE,\n", ")\n", @@ -304,7 +304,9 @@ " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", "else:\n", " print(f\"Run ID: {run.info.run_id}\")\n", - " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + " print(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" ] }, { diff --git a/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb b/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb index ec776b0af1..6242494801 100755 --- a/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb +++ b/sdk/python/using-mlflow/train-and-log/xgboost_nested_runs.ipynb @@ -328,7 +328,7 @@ " \n", " \n", "\n", - "303 rows \u00d7 14 columns
\n", + "303 rows × 14 columns
\n", "" ], "text/plain": [ @@ -613,7 +613,7 @@ "output_type": "stream", "text": [ "Working in MLflow run: 7eca10a6-d166-4714-a251-10f1585eb101\n", - "100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [01:05<00:00, 13.15s/trial, best loss: -0.6]\n", + "100%|███████████████████████████████████████████████████████████████████████████████████| 5/5 [01:05<00:00, 13.15s/trial, best loss: -0.6]\n", "Showing Histogram of 5 jobs\n" ] }, @@ -664,7 +664,7 @@ "hyperopt_run = mlflow.last_active_run()\n", "tracking_uri = mlflow.get_tracking_uri()\n", "match = re.search(\n", - " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " r\"subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)\",\n", " tracking_uri,\n", " re.IGNORECASE,\n", ")\n", @@ -677,7 +677,9 @@ " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", "else:\n", " print(f\"Run ID: {hyperopt_run.info.run_id}\")\n", - " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + " print(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" ] }, { @@ -877,7 +879,7 @@ " \n", " \n", "\n", - "5 rows \u00d7 49 columns
\n", + "5 rows × 49 columns
\n", "" ], "text/plain": [ diff --git a/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb b/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb index 26864bd113..e9828b4308 100644 --- a/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb +++ b/sdk/python/using-mlflow/train-and-log/xgboost_service_principal.ipynb @@ -393,7 +393,7 @@ "# AzureML does not serve a MLflow UI - use Azure ML Studio to view your runs\n", "tracking_uri = mlflow.get_tracking_uri()\n", "match = re.search(\n", - " r'subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)',\n", + " r\"subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.MachineLearningServices/workspaces/([^/?]+)\",\n", " tracking_uri,\n", " re.IGNORECASE,\n", ")\n", @@ -406,7 +406,9 @@ " print(f\"View this run in Azure ML Studio:\\n{studio_url}\")\n", "else:\n", " print(f\"Run ID: {run.info.run_id}\")\n", - " print(\"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\")" + " print(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" ] }, {