Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

Using Bastion to access the jump host via SSH #26394

Open wangzelin007 opened 1 year ago

wangzelin007 commented 1 year ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az network bastion ssh

Errors:

The command failed with an unexpected error. Here is the traceback:
The extension ssh is not installed.
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/network/custom.py", line 8263, in ssh_bastion_host
    _test_extension(SSH_EXTENSION_NAME)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/network/custom.py", line 8191, in _test_extension
    ext = get_extension(extension_name)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/extension/__init__.py", line 340, in get_extension
    raise ExtensionNotInstalledException(ext_name)
azure.cli.core.extension.ExtensionNotInstalledException: The extension ssh is not installed.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Linux-5.19.0-38-generic-x86_64-with-glibc2.35, Ubuntu 22.04.1 LTS
Python 3.10.8
Installer: DEB

azure-cli 2.43.0 *

Extensions:
azure-devops 0.26.0
aks-preview 0.5.123

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

azure-client-tools-bot-prd[bot] commented 1 year ago
Hi @wangzelin007 Find similar issue https://github.com/Azure/azure-cli/issues/26393.
Issue title Azure OpenAI creation hangs (even after the instance creation is complete per the portal)
Create time 2023-05-10
Comment number 0

Please confirm if this resolves your issue. Kindly react a 👍 or 👎 to this comment so that we can improve this robot.

yonzhan commented 1 year ago

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

azure-client-tools-bot-prd[bot] commented 1 year ago
Hi @wangzelin007 Find similar issue https://github.com/Azure/azure-cli/issues/21269.
Issue title Unable to connect to VM using bastion ssh
Create time 2022-02-12
Comment number 10

Possible solution: Apologies for the late reply. Could you please install the ssh extension using the below command ?

az extension add --name ssh

Then confirm if the extension is successfully installed by running the below command:

az extension show -n ssh

After this you can try to run the az network bastion ssh command to connect to the VM and test. Awaiting your reply.


Please confirm if this resolves your issue.

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

microsoft-github-policy-service[bot] commented 1 year ago

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

microsoft-github-policy-service[bot] commented 1 year ago

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