diff --git a/sdk/python/using-mlflow/model-management/model_management.ipynb b/sdk/python/using-mlflow/model-management/model_management.ipynb index d107a5ae66..00a89be98c 100644 --- a/sdk/python/using-mlflow/model-management/model_management.ipynb +++ b/sdk/python/using-mlflow/model-management/model_management.ipynb @@ -142,6 +142,15 @@ "mlflow.set_tracking_uri(azureml_tracking_uri)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **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": {}, @@ -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..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 @@ -229,6 +229,45 @@ "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(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -526,4 +565,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..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 @@ -270,6 +270,45 @@ "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(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -698,4 +737,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..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 @@ -651,6 +651,37 @@ "![](assets/hyperopt_child.png)" ] }, + { + "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(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -952,4 +983,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..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 @@ -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,45 @@ "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(\n", + " \"To view this run, navigate to Azure ML Studio (https://ml.azure.com) and find your experiment.\"\n", + " )" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -524,4 +563,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file