Skip to content

While creating tunnel using az cli, getting below error #30821

@sunilangane74

Description

@sunilangane74

Describe the bug

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22
Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
The command requires the extension bastion. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
The command failed with an unexpected error. Here is the traceback:
[Errno 13] Permission denied
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 470, in create_bastion_tunnel
tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 429, in _get_tunnel
tunnel_server = TunnelServer(cmd.cli_ctx, "localhost", port, bastion, bastion_endpoint, vm_id, resource_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/tunnel.py", line 64, in init
self.sock.bind((self.local_addr, self.local_port))
PermissionError: [Errno 13] Permission denied
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Related command

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22

Errors

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22
Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
The command requires the extension bastion. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
The command failed with an unexpected error. Here is the traceback:
[Errno 13] Permission denied
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 470, in create_bastion_tunnel
tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 429, in _get_tunnel
tunnel_server = TunnelServer(cmd.cli_ctx, "localhost", port, bastion, bastion_endpoint, vm_id, resource_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/tunnel.py", line 64, in init
self.sock.bind((self.local_addr, self.local_port))
PermissionError: [Errno 13] Permission denied
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22

Expected behavior

Tunnel should create

Environment Summary

azure-cli 2.69.0

Additional context

Please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botNetwork - BastionPossible-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