question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az network bastion cannot connect with native client.

See original GitHub issue

In #19240, I recognizes that Azure Bastion native client is supported, but running the command doesn’t work. Would like to know if it is a potential bug, a limited offer, or a mistake in the command option argument.

Describe the bug

Command Name az network bastion ssh and az network bastion rdp

Errors: When I run az network bastion ssh, I get the following message and cannot connect through Bastion.

Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/network/custom.py", line 7757, in _start_tunnel
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/network/tunnel.py", line 183, in start_server
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/network/tunnel.py", line 118, in _listen
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/network/tunnel.py", line 105, in _get_auth_token
msrestazure.azure_exceptions.CloudError: Tunneling is disabled

Bastion-ssh-connect

When I run az network bastion rdp, I get the following dialog box and cannot connect through Bastion.

Bastion-rdp-connect

To Reproduce: An error will occur when you execute a command that includes the following command options.

  • az network bastion ssh --name {} --resource-group {} --target-resource-id {} --auth-type {} --username {} --resource-port 22 --verbose
  • az network bastion rdp --name {} --resource-group {} --target-resource-id {} --resource-port 3389 --verbose

Expected Behavior When I execute az network bastion ssh or az network bastion rdp, will be able to login and operate through Bastion.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.28.0

Extensions:
azure-firewall 0.12.0
ssh 0.1.6
stream-analytics 0.1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
VitalyMCTcommented, Dec 13, 2021

Sure, I’ve just emailed you these details.

Update: Just tried the same RDP command as in the documentation, which was not working as recently as December 9th. It works now. No changes to AZ CLI, Bastion configuration, destination VM or anything else on our end. There must’ve been some kind of an update in Azure that made it work.

1reaction
VitalyMCTcommented, Dec 9, 2021

@aavalang Are you referring to the setting in the screenshot below? It’s already enabled.

image

I am going by the instructions at https://docs.microsoft.com/en-ca/azure/bastion/connect-native-client-windows and believe everything is configured per them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect to a VM using a native client - Bastion - Microsoft Learn
The native client feature lets you connect to your target VMs via Bastion using Azure CLI, and expands your sign-in options to include...
Read more >
Azure Bastion Native Client Support With the Windows RDP ...
Launch the native Remote Desktop client using the az network bastion rdp command as shown below to connect to virtual machines in the...
Read more >
Azure – Use of native client to connect to Azure Bastion is here
Login on the virtual machine through Bastion with native client using a local account is not supported; SSH connection using the private key ......
Read more >
Azure Bastion: Use Native RDP Client to Connect to VMs
Use the az network bastion rdp command to connect to the Windows virtual machine using the native RPD client.
Read more >
RDP via Azure Bastion (native client) - Devolutions Forum
https://docs.microsoft.com/en-us/azure/bastion/connect-native-client-windows. 8 months ago ... az network bastion tunnel --name $($RDMField5.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found