Skip to content

Unable to install az ml extension on Azure CLI version 2.75.0 (Linux) #31744

@sander102907

Description

@sander102907

Describe the bug

On the new release of Azure CLI Version 2.75.0, when installing the az ml extension on Linux, upon first use of the extension (e.g. by calling az ml --help you get the error:

No module named 'msrestazure'
'ml' is misspelled or not recognized by the system.

Even though az version gives:

{
  "azure-cli": "2.75.0",
  "azure-cli-core": "2.75.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "ml": "2.37.1"
  }
}

When downgrading back to Azure CLI version 2.74.0, the az ml extension can be used without issues.

Related command

az ml --help

Errors

No module named 'msrestazure'
'ml' is misspelled or not recognized by the system.

Issue script & Debug output

az ml --help --debug
cli.knack.cli: Command arguments: ['ml', '--help', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f0e66cdb880>, <function OutputProducer.on_global_arguments at 0x7f0e66a367a0>, <function CLIQuery.on_global_arguments at 0x7f0e66a7bce0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: No module found from index for '['ml', '--help', '--debug']'
cli.azure.cli.core: Loading all modules and extensions
cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'compute_recommender', 'computefleet', 'config', 'configure', 'consumption', 'container', 'containerapp', 'cosmosdb', 'databoxedge', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'keyvault', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'mysql', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: acr                       0.076        36       149
cli.azure.cli.core: acs                       0.017        15        79
cli.azure.cli.core: advisor                   0.001         3         6
cli.azure.cli.core: ams                       0.004        22       100
cli.azure.cli.core: apim                      0.005        14        69
cli.azure.cli.core: appconfig                 0.003         9        47
cli.azure.cli.core: appservice                0.019        80       277
cli.azure.cli.core: aro                       0.008         1        10
cli.azure.cli.core: backup                    0.003        16        60
cli.azure.cli.core: batch                     0.061        32        96
cli.azure.cli.core: batchai                   0.002        10        30
cli.azure.cli.core: billing                   0.012        20        53
cli.azure.cli.core: botservice                0.003        12        42
cli.azure.cli.core: cdn                       0.137         8        50
cli.azure.cli.core: cloud                     0.001         1         7
cli.azure.cli.core: cognitiveservices         0.002        10        33
cli.azure.cli.core: compute_recommender       0.002         1         1
cli.azure.cli.core: computefleet              0.005         1         1
cli.azure.cli.core: config                    0.001         2         7
cli.azure.cli.core: configure                 0.001         2         5
cli.azure.cli.core: consumption               0.012         8         9
cli.azure.cli.core: container                 0.007         2        17
cli.azure.cli.core: containerapp              0.080        37       123
cli.azure.cli.core: cosmosdb                  0.011        58       200
cli.azure.cli.core: databoxedge               0.005         5        28
cli.azure.cli.core: dls                       0.002         6        36
cli.azure.cli.core: dms                       0.002         3        22
cli.azure.cli.core: eventgrid                 0.004        25        96
cli.azure.cli.core: eventhubs                 0.008        13        20
cli.azure.cli.core: extension                 0.001         1         7
cli.azure.cli.core: feedback                  0.001         1         2
cli.azure.cli.core: find                      0.001         1         1
cli.azure.cli.core: hdinsight                 0.004         9        42
cli.azure.cli.core: identity                  0.005         2         7
cli.azure.cli.core: interactive               0.001         1         1
cli.azure.cli.core: iot                       0.066        19        82
cli.azure.cli.core: keyvault                  0.007        20       114
cli.azure.cli.core: lab                       0.057         9        30
cli.azure.cli.core: managedservices           0.007         3         8
cli.azure.cli.core: maps                      0.001         5        13
cli.azure.cli.core: marketplaceordering       0.002         1         2
cli.azure.cli.core: monitor                   0.391        18        63
cli.azure.cli.core: mysql                     0.054        16        56
cli.azure.cli.core: netappfiles               0.032         8        15
cli.azure.cli.core: network                   0.103       106       351
cli.azure.cli.core: policyinsights            0.008         9        17
cli.azure.cli.core: privatedns                0.019        14        60
cli.azure.cli.core: profile                   0.001         2         8
cli.azure.cli.core: rdbms                     0.141        52       217
cli.azure.cli.core: redis                     0.002         7        38
cli.azure.cli.core: relay                     0.020         7         8
cli.azure.cli.core: resource                  0.012        52       232
cli.azure.cli.core: role                      0.003        17        62
cli.azure.cli.core: search                    0.005         7        19
cli.azure.cli.core: security                  0.007        47        98
cli.azure.cli.core: servicebus                0.006        13        16
cli.azure.cli.core: serviceconnector          0.044        20       331
cli.azure.cli.core: servicefabric             0.009        27        80
cli.azure.cli.core: signalr                   0.002        10        42
cli.azure.cli.core: sql                       0.011        56       215
cli.azure.cli.core: sqlvm                     0.019         4        20
cli.azure.cli.core: storage                   0.043        60       275
cli.azure.cli.core: synapse                   0.010        54       246
cli.azure.cli.core: util                      0.001         3         7
cli.azure.cli.core: vm                        0.072        59       213
cli.azure.cli.core: Total (65)                1.663      1192      4671
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: init                      0.002         1         1  /root/.azure/cliextensions/init
azext_mlv2.manual.vendored_curated_sdk.azure.ai.ml._azure_environments: Using the default cloud configuration: 'AzureCloud'.
azext_mlv2.manual.vendored_curated_sdk.azure.ai.ml._azure_environments: Using the default cloud configuration: 'AzureCloud'.
azext_mlv2.manual.vendored_curated_sdk.azure.ai.ml._azure_environments: Using the default cloud configuration: 'AzureCloud'.
No module named 'msrestazure'
cli.azure.cli.core: ml                        2.821         1         0  /root/.azure/cliextensions/ml
cli.azure.cli.core: Total (2)                 2.822         2         1
cli.azure.cli.core: Loaded 1179 groups, 4672 commands.
cli.azure.cli.core: Updated command index in 0.005 seconds.
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f0e65c6fe20>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2025-07-01.11-55-39.unknown_command.4121682.log'.
az_command_data_logger: command args: ml --help --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f0e656cf560>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f0e656cf600>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f0e656cf740>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x7f0e656cf7e0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7f0e63fce200>]
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22ml%22%2C+%22parameters%22%3A+%22--help%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.75.0%22%2C+%22errorType%22%3A+%22UnknownSubcommand%22%2C+%22correlationId%22%3A+%22801cf970-b0d5-4603-8fb0-31829cdf6891%22%2C+%22eventId%22%3A+%226a6051ac-f73c-4b03-9e2b-74dcbc1d6592%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.command_recommender: "--name" is an invalid parameter for command "ml".
cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: 'ml' is misspelled or not recognized by the system.
az_command_data_logger: '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://docs.microsoft.com/en-US/cli/azure/extension#az_extension_add
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f0e65c700e0>]
az_command_data_logger: exit code: 2
cli.__main__: Command ran in 5.163 seconds (init: 0.405, invoke: 4.758)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3857 in cache file under /root/.azure/telemetry/20250701115539626
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.12/site-packages/azure/cli/telemetry/__init__.py /root/.azure /root/.azure/telemetry/20250701115539626"
telemetry.process: Return from creating process 4121706
telemetry.main: Finish creating telemetry upload process.

Expected behavior

The az ml help command to give the possible options instead of giving the error

Environment Summary

{
  "azure-cli": "2.75.0",
  "azure-cli-core": "2.75.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "ml": "2.37.1"
  }
}

Additional context

This only seems to happen on Linux, not Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botMachine Learningaz mlPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-IssuebugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions