Azure MLv2 CLI extension not recognized in DevOps

Trevor Philley 1 Reputation point
2022-07-08T17:42:56.18+00:00

Having some trouble with one of our DevOps pipelines. In the pipeline, we install the Azure MLv2 CLI extension and then use the extension to make a call to our AzureML workspace. The pipeline was working fine yesterday, but now results in an error saying that 'ml' is misspelled or not recognized. There is an additional message about a name import that might be causing the issue. Here is the full error message:

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

https://learn.microsoft.com/en-US/cli/azure/extension#az_extension_add
Read more about the command in reference docs
cannot import name 'case_insensitive_dict' from 'azure.core.utils' (/opt/az/lib/python3.10/site-packages/azure/core/utils/init.py)

Azure CLI Versions:
WARNING: You have 2 updates available. Consider updating your CLI installation with 'az upgrade'
azure-cli 2.37.0 *

Please let us know how we are doing: https://aka.ms/azureclihats
core 2.37.0 *
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
telemetry 1.0.6

Extensions:
ml 2.5.0
azure-devops 0.25.0

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.10.4 (main, May 23 2022, 14:03:08) [GCC 9.4.0]

Trying to update the CLI version also results in an error

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,332 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Thierry Carels 6 Reputation points
    2022-07-09T07:07:56.847+00:00

    I'm facing the same issue in Azure DevOps. My last successful test was on Tuesday 5th July, but on Friday 8th this error appeared.

    As it is not easy to change the installed version on Microsoft or self-hosted agents, an other workaround is to install the version 2.4.1 of the az ml extension in place of the latest one.

    az extension add --name ml --version 2.4.1 --yes  
    

    One more thing, on the Azure Machine Learning CLI (v2) release notes, the version 2.5.0 is not listed.

    1 person found this answer helpful.
    0 comments No comments

  2. Trevor Philley 1 Reputation point
    2022-07-08T20:39:50.49+00:00

    In case anyone else is having issues with this, rolling the CLI back to 2.36.0 seems to be working

    0 comments No comments

  3. Debanjan Banerjee 1 Reputation point
    2022-09-15T12:28:41.863+00:00

    Hi,

    I am facing the same issue from today in Azure DevOps. The agent is ubuntu for me. Below is the error. Please help here. It has become a roadblock for us.

    module.azml_test.null_resource.azure-ml: Still creating... [30s elapsed]
    module.azml_test.null_resource.azure-ml (local-exec): WARNING: Unable to load extension 'azure-cli-ml: cannot import name 'case_insensitive_dict' from 'azure.core.utils' (/opt/az/lib/python3.8/site-packages/azure/core/utils/init.py)'. Use --debug for more information.
    module.azml_test.null_resource.azure-ml (local-exec): WARNING: Command group 'config' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

    module.azml_test.null_resource.azure-ml (local-exec): WARNING: Unable to load extension 'azure-cli-ml: cannot import name 'case_insensitive_dict' from 'azure.core.utils' (/opt/az/lib/python3.8/site-packages/azure/core/utils/init.py)'. Use --debug for more information.
    module.azml_test.null_resource.azure-ml (local-exec): ERROR: 'ml' is misspelled or not recognized by the system.

    module.azml_test.null_resource.azure-ml (local-exec): Examples from AI knowledge base:
    module.azml_test.null_resource.azure-ml (local-exec): az extension add --name anextension
    module.azml_test.null_resource.azure-ml (local-exec): Add extension by name

    0 comments No comments

  4. Karolina Parkitna 1 Reputation point
    2022-09-21T05:21:15.213+00:00

    Hi!
    I have the same problem:
    "Unable to load extension 'azure-cli-ml: cannot import name 'CaseInsensitiveEnumMeta''. Use --debug for more information.
    'ml' is misspelled or not recognized by the system."

    Versions:
    azure-cli 2.22.1 *
    core 2.22.1 *
    telemetry 1.0.6

    Extensions:
    azure-cli-ml 1.41.0
    ml 2.4.1

    Did you find a solution? Should I downgrade to any other version? If yes - which one?

    Thanks for help!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.