Azure ML Model Drift & Health Dashboard
Proactive ML model health monitoring directly in VS Code. Detect data drift, track prediction quality, and get traffic-light alerts before your models silently degrade.
The Problem
After deploying ML models to Azure ML endpoints, there is no proactive VS Code-based monitoring for data drift, prediction drift, or performance degradation. Teams discover their model is broken when business metrics drop — weeks too late.
The Solution
This extension connects to your Azure ML workspace, pulls inference metrics in real-time, calculates statistical drift scores (PSI, KS-test), and presents a traffic-light dashboard right in VS Code.
"3 of your 7 models are degrading" — see it at a glance, not after a business review.
Features
A dedicated Activity Bar panel shows all your online endpoints with color-coded health:
- 🟢 Green — PSI < 0.1, no issues
- 🟡 Yellow — PSI 0.1–0.2 or elevated latency
- 🔴 Red — PSI > 0.2, high error rate, or significant KS-test drift
Drift Dashboard (Webview)
Click any endpoint to see a detailed dashboard with:
- Overall PSI & KS scores
- Feature-level drift table with per-feature PSI, KS statistic, p-value, and visual drift bars
- Latency & error rate cards
- Request volume over the last 24 hours
- Active issues and deployment details
Status Bar Summary
A persistent status bar item shows at-a-glance health: ML: 5✓ 1⚠ 1✗
- Background turns red if any endpoint is critical
- Background turns yellow if any endpoint is in warning state
Proactive VS Code Alerts
When drift exceeds your configured thresholds, the extension:
- Fires a VS Code notification with a direct link to the dashboard
- Adds the alert to the Drift Alerts panel in the sidebar
- Deduplicates alerts (1-hour window per endpoint per metric)
Health Report Export
Generate a JSON health report for all endpoints — useful for MLOps reviews, compliance, and Slack/email integrations.
Getting Started
1. Install the Extension
Install from the VS Code Marketplace or from VSIX:
code --install-extension azure-ml-drift-monitor-1.0.0.vsix
Open VS Code Settings (Ctrl+,) and search for mlDrift:
| Setting |
Description |
Default |
mlDrift.subscriptionId |
Azure subscription ID |
— |
mlDrift.resourceGroup |
Resource group containing the workspace |
— |
mlDrift.workspaceName |
Azure ML workspace name |
— |
mlDrift.tenantId |
Azure AD tenant ID (optional) |
default tenant |
mlDrift.refreshIntervalMinutes |
Auto-refresh interval (0 = disabled) |
30 |
Or add to your settings.json:
{
"mlDrift.subscriptionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"mlDrift.resourceGroup": "my-ml-rg",
"mlDrift.workspaceName": "my-ml-workspace",
"mlDrift.refreshIntervalMinutes": 15
}
3. Connect
Open the Command Palette (Ctrl+Shift+P) and run:
ML Drift: Connect to Azure ML Workspace
The extension uses DefaultAzureCredential from @azure/identity, which supports:
- Azure CLI login (
az login)
- VS Code Azure Account extension
- Managed Identity (in Azure-hosted environments)
- Environment variables (service principal)
4. Run a Drift Check
Right-click any endpoint in the sidebar and select Run Drift Check Now, or use:
ML Drift: Run Drift Check Now
Drift Detection Methods
Population Stability Index (PSI)
Compares the distribution of input features between a baseline (training) dataset and current inference data.
| PSI Score |
Interpretation |
| < 0.1 |
No significant drift |
| 0.1 – 0.2 |
Moderate drift — investigate |
| > 0.2 |
Significant drift — retrain recommended |
Kolmogorov-Smirnov (KS) Test
A non-parametric test measuring the maximum distance between two cumulative distribution functions.
| KS p-value |
Interpretation |
| > 0.05 |
Distributions are similar |
| 0.01 – 0.05 |
Moderate evidence of drift |
| < 0.01 |
Strong evidence of drift |
Configurable Thresholds
| Setting |
Description |
Default |
mlDrift.psiWarningThreshold |
PSI score for yellow status |
0.1 |
mlDrift.psiCriticalThreshold |
PSI score for red status |
0.2 |
mlDrift.ksWarningThreshold |
KS p-value for yellow status |
0.05 |
mlDrift.ksCriticalThreshold |
KS p-value for red status |
0.01 |
mlDrift.latencyWarningMs |
Latency threshold (ms) |
500 |
mlDrift.errorRateWarningPct |
Error rate threshold (%) |
5 |
Commands
| Command |
Description |
ML Drift: Connect to Azure ML Workspace |
Authenticate and connect |
ML Drift: Refresh Endpoints |
Manually refresh all endpoints |
ML Drift: Open Drift Dashboard |
Open the overview health report |
ML Drift: Run Drift Check Now |
Trigger an on-demand drift analysis |
ML Drift: Configure Drift Thresholds |
Open threshold settings |
ML Drift: Export Health Report |
Save a JSON health report |
ML Drift: Disconnect Workspace |
Disconnect from the workspace |
Required Azure Permissions
The authenticated identity needs these Azure RBAC roles on the ML workspace:
| Role |
Purpose |
| Reader |
List endpoints and deployments |
| AzureML Data Scientist |
Access inference logs |
| Monitoring Reader |
Query Azure Monitor metrics |
Architecture
┌─────────────────────────────────────────────┐
│ VS Code Extension │
│ │
│ ┌─────────────┐ ┌──────────────────────┐ │
│ │ Tree View │ │ Drift Dashboard │ │
│ │ (Sidebar) │ │ (Webview Panel) │ │
│ │ ● Endpoint1 │ │ ┌──────┐ ┌────────┐ │ │
│ │ ● Endpoint2 │ │ │ PSI │ │ Drift │ │ │
│ │ ○ Endpoint3 │ │ │ Card │ │ Table │ │ │
│ └─────────────┘ │ └──────┘ └────────┘ │ │
│ └──────────────────────┘ │
│ ┌──────────────────────────────┐ │
│ │ Status Bar: ML: 5✓ 1⚠ 1✗ │ │
│ └──────────────────────────────┘ │
│ │
│ ┌───────────────┐ ┌────────────────────┐ │
│ │ Health │ │ Drift Calculator │ │
│ │ Monitor │──│ (PSI, KS-test) │ │
│ │ (Poll Loop) │ └────────────────────┘ │
│ └───────┬───────┘ │
│ │ │
└──────────┼──────────────────────────────────┘
│
┌──────▼──────┐ ┌──────────────┐
│ Azure ML │ │ Azure Monitor│
│ REST API │ │ Metrics API │
└─────────────┘ └──────────────┘
Troubleshooting
| Issue |
Solution |
| "Not connected to a workspace" |
Run ML Drift: Connect to Azure ML Workspace |
| Authentication fails |
Run az login in your terminal or install the Azure Account extension |
| No endpoints found |
Verify the workspace has online endpoints deployed |
| Metrics unavailable |
Ensure the identity has Monitoring Reader role |
| Drift shows N/A |
Run a drift check to generate baseline data |
License
MIT