Skip to content

az ml command not working as expected after 08/23/2025 - ERROR: 'ml' is misspelled or not recognized by the system #32014

Description

@DevOpsCraftsman28

Describe the bug

Hi,

The original script as shown below:

  inlineScript: |
    set -x
    az extension add -n ml

    echo Creating endpoint ...
    cat endpoint.yml
    az ml online-endpoint create --file endpoint.yml --resource-group $(workspaceResourceGroup) --workspace-name $(workspaceName)
    echo Deploying managed online endpoint ...

    # <check_endpoint_Status>
    endpoint_status=`az ml online-endpoint show -n $MANAGEDENDPOINTNAME --resource-group $(workspaceResourceGroup) --workspace-name $(workspaceName) --query "provisioning_state" -o tsv`

In the ado pipeline log:

WARNING: Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
WARNING: Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
ERROR: 'ml' is misspelled or not recognized by the system.

Examples from AI knowledge base:
az extension add --name anextension
Add extension by name

az extension list-available
List all publicly available extensions

Everything was fine on the previous day 08/22/2025.

When I debug with
az extension add -n ml --system -y
az extension list

cannot import name 'AzureOpenAIDeployment' from 'azure.ai.ml.entities' (/usr/local/miniconda/lib/python3.10/site-packages/azure/ai/ml/entities/init.py)
[
{
"experimental": false,
"extensionType": "whl",
"name": "ml",
"path": "/usr/local/miniconda/lib/python3.10/site-packages/azure-cli-extensions/ml",
"preview": false,
"version": "2.38.1"
}
]

Notes: the python package version for azure-ai-ml is 1.14.0

Any suggestions I can try to resolve the issues with "az ml" command?

Thanks!

Related command

az ml

Errors

WARNING: Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
WARNING: Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
ERROR: 'ml' is misspelled or not recognized by the system.

Examples from AI knowledge base:
az extension add --name anextension
Add extension by name

az extension list-available
List all publicly available extensions

Issue script & Debug output

az ml

Expected behavior

it should execute the az ml command without any errors

Environment Summary

az/usr/local/miniconda/bin/az --version
azure-cli 2.76.0

core 2.76.0
telemetry 1.1.0

Extensions:
azure-devops 1.0.2
ml 2.38.0
xsignextension 0.48

Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0

Python location '/usr/local/miniconda/bin/python'
Config directory '/root/.azure'
Extensions directory '/root/.azure/cliextensions'

Python (Linux) 3.10.16 (main, Dec 11 2024, 16:24:50) [GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

Activity

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Aug 27, 2025
  2. yonzhan commented on Aug 27, 2025

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  3. github-actions commented on Aug 27, 2025

    @github-actions

    Here are some similar issues that might help you. Please check if they can solve your problem.


    Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

    Solution 1:

    This issue is resolved with the latest release of az ml extension 2.37.2. Please install the latest ml extension:

    az extension remove -n ml
    az extension add -n ml
    

    Reference:

    Solution 2:

    Downgrade the Azure CLI to a version that is compatible with the ml extension. For example, downgrading to Azure CLI version 2.70.0 has resolved similar issues:

    az --version
    azure-cli                         2.70.0 *
    
    core                              2.70.0 *
    telemetry                          1.1.0
    
    Extensions:
    azure-devops                      0.18.0
    ml                                2.36.3
    

    Reference:

    Solution 3:

    Ensure that the ml extension is installed correctly and matches the Azure CLI version. If the extension is already installed, try updating it to the latest version or reinstalling it:

    az extension add --name ml
    az extension update --name ml
    

    Reference:

    Powered by issue-sentinel

  4. microsoft-github-policy-service commented on Aug 27, 2025

    @microsoft-github-policy-service
    Contributor

    Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc azureml-github.

  5. azclibot commented on Jun 23, 2026

    @azclibot
    Collaborator

    Bug Analysis

    Issue: az ml commands fail with ERROR: 'ml' is misspelled or not recognized by the system after installing the ml extension, due to an underlying import error:

    cannot import name 'AzureOpenAIDeployment' from 'azure.ai.ml.entities' (/usr/local/miniconda/lib/python3.10/site-packages/azure/ai/ml/entities/__init__.py)
    

    Root cause: The ml CLI extension v2.38.1 references AzureOpenAIDeployment from azure-ai-ml, but the environment has azure-ai-ml==1.14.0 which does not export that symbol. When the extension module fails to import, the CLI falls back to the "misspelled or not recognized" error message.

    Environment:

    • Azure CLI: 2.76.0
    • ml extension: 2.38.1
    • azure-ai-ml: 1.14.0
    • Python: 3.10.16 (Linux)

    Steps to fix:

    1. Check the ml extension's minimum version requirement for azure-ai-ml — ensure that requirement is declared correctly so the installer enforces it.
    2. If the incompatibility is in the extension loading path, improve the error message in the extension command module to surface the underlying ImportError instead of reporting "misspelled or not recognized".
    3. Reproduce with az extension add -n ml followed by az ml online-endpoint create with the pinned azure-ai-ml==1.14.0 to confirm.

    PR title & description format (required)

    This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.

    Title

    • Start with [Extension] — square brackets [] for a customer-facing change (added to HISTORY.rst), curly {} if not. A bug fix is customer-facing, so use [].
    • Then Fix #32014: to link the issue (use the short #N form, not owner/repo#N).
    • Then the affected command wrapped in backticks followed by a colon — e.g. `az vm create`:. ⚠️ The format check fails if the az ... command in the title is not inside backticks.
    • Then a present-tense, capitalized verb (Fix for bug fixes; Add/Change/Deprecate/Remove otherwise) and a concise summary.
    • Recommended title (note the backticks around the command):
    [Extension] Fix #32014: `az <command>`: Fix <concise description of the fix>
    

    Description — follow the PR template and fill in:

    • Link the issue — start the Description with a closing keyword so the PR auto-links and closes it: Fixes #32014.
    • Related command — the az ... command this affects.
    • Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
    • Testing Guide — example command(s) showing the fix works.
    • History Notes — leave the title to drive the history note, or add extra lines in the same format (component in brackets + the command in backticks), e.g. [Extension] `az <command>`: <note>.
    • Keep the template checklist and tick the items you've satisfied.

    Posted by agent-assist (autonomous bug-fix pipeline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions