azure-cli: az ssh config - windows - missing rpds python module

Command Name az ssh config

Issue Summary After upgrading Azure CLI from version 2.65 to 2.66, the az ssh config command now produces an error due to a missing module, rpds.rpds. This issue seems to specifically affect the az ssh config command, even when other ssh-related commands like az ssh vm function without issue. This differs from previous reports of rpds.rpds errors tied to az ssh vm or other SSH commands in the CLI.

Errors:

No module named "rpds.rpds"

This suggests that a dependency may be missing or was improperly packaged in the 2.66 update, leading to an unexpected failure in running SSH configuration commands.

Steps to Reproduce:

  1. Upgrade Azure CLI from version 2.65 to 2.66.
  2. Install any required extensions:
    • aks-preview (version 9.0.0b7)
    • azure-iot (version 0.25.0)
    • interactive (version 1.0.0b1)
  3. Run:
    az ssh config --ip {Your_IP} --file {Path_to_File} --keys-dest-folder {Destination_Folder}
    

Expected Behavior

The command should execute successfully, generating SSH configuration files and placing them in the specified --keys-dest-folder without dependency-related errors.

Actual Behavior

The command fails with a ModuleNotFoundError: No module named "rpds.rpds" error, preventing SSH configuration.

Environment Summary

Operating System: Windows 11, Version 10.0.22631
Python: 3.12.7
Installer: MSI

Azure CLI version: 2.66.0
Extensions:
- aks-preview 9.0.0b7
- azure-iot 0.25.0
- interactive 1.0.0b1

Dependencies:
- msal 1.31.0
- azure-mgmt-resource 23.1.1

Additional Context

This bug seems unique to the 2.66 update, as it did not occur in 2.65. Attempting to downgrade may serve as a temporary workaround, but please note that downgrading is not always feasible depending on dependency requirements and setup configurations.

Why This Differs from #29938

While issue #29938 also references rpds.rpds errors, that issue generally impacts az ssh vm and similar commands, resulting from issues with SSH connection setups to Azure VMs. In this case, az ssh config fails independently, suggesting that the dependency error in version 2.66 may be specific to the configuration functions and related only to this command.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 7
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Python version bumped to 3.12 in 2.66.0. ssh extension’s dependency rpds-py does not have a cross-platform wheel, which means Python 3.11 package isn’t compatible with Python 3.12.

Reinstalling the ssh extension should fix the issue: az extension remove -n ssh && az extension add -n ssh

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:

Reinstalling the SSH extension can resolve the issue. You can do this by running:

az extension remove -n ssh && az extension add -n ssh

This solution has been confirmed to work by multiple users.

Reference:

Solution 2:

Updating the SSH extension might also fix the problem. You can update the extension using:

az extension update --name ssh

This solution has been confirmed to work by users.

Reference:

Solution 3:

Manually installing the missing module in the Azure CLI virtual environment can be a workaround. You can do this by running:

$(brew --cellar az)/2.66.0/libexec/bin/pip install rpds-py

This solution worked for a user who did not want to reinstall the entire CLI.

Reference: