Skip to content

Installing an extension with uv tool install --prerelease=allow --with resource-graph azure-cli==2.83.0 is not enough to pick up the extension? #9730

Description

Describe the bug

Installing an extension with uv tool install --prerelease=allow --with resource-graph azure-cli==2.83.0 is not enough to pick up the extension?

Related command

az graph query ...

Errors

cli.azure.cli.core.extension.operations: Executing pip with args: ['install', '--target', '/home/u/.azure/cliextensions/resource-graph', '/tmp/tmpko3of59e/resource_graph-2.1.1-py2.py3-none-any.whl']
cli.azure.cli.core.extension.operations: Running: ['/home/u/.local/share/uv/tools/azure-cli/bin/python3', '-m', 'pip', 'install', '--target', '/home/u/.azure/cliextensions/resource-graph', '/tmp/tmpko3of59e/resource_graph-2.1.1-py2.py3-none-any.whl', '--disable-pip-version-check', '--no-cache-dir']
cli.azure.cli.core.extension.operations: /home/u/.local/share/uv/tools/azure-cli/bin/python3: No module named pip

cli.azure.cli.core.extension.operations: Command '['/home/u/.local/share/uv/tools/azure-cli/bin/python3', '-m', 'pip', 'install', '--target', '/home/u/.azure/cliextensions/resource-graph', '/tmp/tmpko3of59e/resource_graph-2.1.1-py2.py3-none-any.whl', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1.
cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at /home/u/.azure/cliextensions/resource-graph
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 669, in execute
    raise ex
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 737, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 706, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/command_modules/extension/custom.py", line 16, in add_extension_cmd
    return add_extension(cli_ctx=cmd.cli_ctx, source=source, extension_name=extension_name, index_url=index_url,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/extension/operations.py", line 343, in add_extension
    extension_name = _add_whl_ext(cli_ctx=cmd_cli_ctx, source=source, ext_sha256=ext_sha256,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/extension/operations.py", line 172, in _add_whl_ext
    raise CLIError('An error occurred. Pip failed with status code {}. '
knack.util.CLIError: An error occurred. Pip failed with status code 1. Use --debug for more information.

cli.azure.cli.core.azclierror: An error occurred. Pip failed with status code 1. Use --debug for more information.
az_command_data_logger: An error occurred. Pip failed with status code 1. Use --debug for more information.

Issue script & Debug output

cli.azure.cli.core.extension.operations: Executing pip with args: ['install', '--target', '/home/u/.azure/cliextensions/resource-graph', '/tmp/tmpko3of59e/resource_graph-2.1.1-py2.py3-none-any.whl']
cli.azure.cli.core.extension.operations: Running: ['/home/u/.local/share/uv/tools/azure-cli/bin/python3', '-m', 'pip', 'install', '--target', '/home/u/.azure/cliextensions/resource-graph', '/tmp/tmpko3of59e/resource_graph-2.1.1-py2.py3-none-any.whl', '--disable-pip-version-check', '--no-cache-dir']
cli.azure.cli.core.extension.operations: /home/u/.local/share/uv/tools/azure-cli/bin/python3: No module named pip

cli.azure.cli.core.extension.operations: Command '['/home/u/.local/share/uv/tools/azure-cli/bin/python3', '-m', 'pip', 'install', '--target', '/home/u/.azure/cliextensions/resource-graph', '/tmp/tmpko3of59e/resource_graph-2.1.1-py2.py3-none-any.whl', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1.
cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at /home/u/.azure/cliextensions/resource-graph
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 669, in execute
    raise ex
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 737, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 706, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/command_modules/extension/custom.py", line 16, in add_extension_cmd
    return add_extension(cli_ctx=cmd.cli_ctx, source=source, extension_name=extension_name, index_url=index_url,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/extension/operations.py", line 343, in add_extension
    extension_name = _add_whl_ext(cli_ctx=cmd_cli_ctx, source=source, ext_sha256=ext_sha256,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/u/.local/share/uv/tools/azure-cli/lib/python3.12/site-packages/azure/cli/core/extension/operations.py", line 172, in _add_whl_ext
    raise CLIError('An error occurred. Pip failed with status code {}. '
knack.util.CLIError: An error occurred. Pip failed with status code 1. Use --debug for more information.

cli.azure.cli.core.azclierror: An error occurred. Pip failed with status code 1. Use --debug for more information.
az_command_data_logger: An error occurred. Pip failed with status code 1. Use --debug for more information.

Expected behavior

With the extension clearly installed

$ ~/.local/share/uv/tools/azure-cli$ ls -lah lib/python3.12/site-packages/azext_resourcegraph/
total 68K
drwxrwxr-x   4 u u 4,0K Μαρ  26 16:37 .
drwxrwxr-x 209 u u  16K Μαρ  26 16:53 ..
-rw-rw-r--   2 u u   74 Μαρ  26 16:36 azext_metadata.json
-rw-rw-r--   2 u u  693 Μαρ  26 16:36 _client_factory.py
-rw-rw-r--   2 u u 1,2K Μαρ  26 16:36 commands.py
-rw-rw-r--   2 u u 5,8K Μαρ  26 16:36 custom.py
-rw-rw-r--   2 u u 4,3K Μαρ  26 16:36 _help.py
-rw-rw-r--   2 u u 1,3K Μαρ  26 16:36 __init__.py
-rw-rw-r--   2 u u 3,7K Μαρ  26 16:36 _params.py
drwxrwxr-x   3 u u 4,0K Μαρ  26 16:37 tests
-rw-rw-r--   2 u u 1,4K Μαρ  26 16:36 _validators.py
drwxrwxr-x   3 u u 4,0K Μαρ  26 16:37 vendored_sdks

there should be no need to "re-install" the extension

Environment Summary

azure-cli==2.83.0

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 Mar 26, 2026
  2. added
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    customer-reportedIssues that are reported by GitHub users external to the Azure organization.
    on Mar 26, 2026
  3. yonzhan commented on Mar 26, 2026

    @yonzhan
    Collaborator

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis 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.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions