azure-cli-extensions
azure-cli-extensions copied to clipboard
Could not connect to my Azure VM in a given resource group
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az ssh vm Extension Name: ssh. Version: 0.1.5.
Errors:
The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'id'
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.24.2/libexec/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/Cellar/azure-cli/2.24.2/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
raise ex
File "/usr/local/Cellar/azure-cli/2.24.2/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/local/Cellar/azure-cli/2.24.2/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
result = cmd_copy(params)
File "/usr/local/Cellar/azure-cli/2.24.2/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.24.2/libexec/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/dhubau/.azure/cliextensions/ssh/azext_ssh/custom.py", line 21, in ssh_vm
_do_ssh_op(cmd, resource_group_name, vm_name, ssh_ip,
File "/Users/dhubau/.azure/cliextensions/ssh/azext_ssh/custom.py", line 40, in _do_ssh_op
ssh_ip = ssh_ip or ip_utils.get_ssh_ip(cmd, resource_group, vm_name, use_private_ip)
File "/Users/dhubau/.azure/cliextensions/ssh/azext_ssh/ip_utils.py", line 27, in get_ssh_ip
parsed_ip_id = tools.parse_resource_id(public_ip_ref.id)
AttributeError: 'NoneType' object has no attribute 'id'
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az ssh vm --resource-group {} --name {}
Expected Behavior
Environment Summary
macOS-11.5.1-x86_64-i386-64bit
Python 3.8.10
Installer: HOMEBREW
azure-cli 2.24.2 *
Extensions:
ssh 0.1.5
Additional Context
route to service team
@Turbots Make sure to use the most recent version of az cli and the ssh extension. ("az upgrade" and "az extension update --name ssh"). Let us know if that solves the issue.
This should be fixed, feel free to reopen if this issue persists.