Skip to content

Fix e2e-ml-workflow notebook: pin MLflow version and add NCD deployment dependencies - #3902

Merged
lavakumarrepala merged 16 commits into
mainfrom
v-rlava/e2e-mlfow-2
May 8, 2026
Merged

Fix e2e-ml-workflow notebook: pin MLflow version and add NCD deployment dependencies#3902
lavakumarrepala merged 16 commits into
mainfrom
v-rlava/e2e-mlfow-2

Conversation

@lavakumarrepala

Copy link
Copy Markdown
Member

Description

Checklist

  • I have read the contribution guidelines.
  • I have coordinated with the docs team (mldocs@microsoft.com) if this PR deletes files or changes any file names or file extensions.
  • Pull request includes test coverage for the included changes.
  • This notebook or file is added to the CODEOWNERS file, pointing to the author or the author's team.

@lavakumarrepala
lavakumarrepala force-pushed the v-rlava/e2e-mlfow-2 branch 4 times, most recently from 7ea532f to 343d5d8 Compare May 6, 2026 18:43
Three issues fixed:
1. Auto-generated MLflow scoring script imports azureml.ai.monitoring
   which is missing from auto-built env. Fixed with explicit conda env.

2. The mlflow.pyfunc.scoring_server.infer_and_parse_data and
   predictions_to_json functions were removed in mlflow 3.x. Rewrote
   score.py to parse input_data (split-oriented DataFrame) with pandas
   and serialize predictions with numpy/json directly.

3. Fixed model path: AZUREML_MODEL_DIR points to registration root but
   MLflow artifacts (MLmodel, model.pkl) are in a subdirectory. The
   score.py walks the directory to find the MLmodel file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lavakumarrepala lavakumarrepala changed the title Update e2e-ml-workflow.ipynb Fix e2e-ml-workflow notebook: pin MLflow version and add NCD deployment dependencies May 7, 2026
@lavakumarrepala

Copy link
Copy Markdown
Member Author

Root Cause

The notebook's conda.yaml uses unpinned mlflow, which installs the latest version. MLflow
2.17+ introduced a logged-models API (/api/2.0/mlflow/logged-models) that Azure ML's tracking server does not
support, causing a 404 during mlflow.sklearn.log_model().
After Azure/azureml-assets#4579 , the platform's no-code deployment (NCD) scoring script
(mlflow_core_script.py) changed its import from mlmonitoring to azureml.ai.monitoring. The notebook's MLflow
model does not declare these packages as dependencies, so the auto-generated NCD inference environment is
missing them and the container crashes on startup.
Fix

Pin mlflow==2.16.2 in the training environment conda.yaml (latest version supported by Azure ML)
Add extra_pip_requirements=["azureml-ai-monitoring", "azureml-inference-server-http"] to
mlflow.sklearn.log_model() so the registered model's dependency metadata includes the packages required by the
NCD scoring environment

@lavakumarrepala
lavakumarrepala merged commit 1c5e239 into main May 8, 2026
5 checks passed
@lavakumarrepala
lavakumarrepala deleted the v-rlava/e2e-mlfow-2 branch May 8, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants