Skip to content

Commit 85ed08b

Browse files
authored
Merge pull request #186533 from tanuballa/patch-188
add tunnel command docs
2 parents e381ad9 + 89c2fa3 commit 85ed08b

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

articles/bastion/connect-native-client-windows.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ ms.author: cherylmc
1111
ms.custom: ignite-fall-2021
1212
---
1313

14-
# Connect to a VM using Bastion and the native client on your Windows computer (Preview)
14+
# Connect to a VM using Bastion and the native client on your workstation (Preview)
1515

16-
Azure Bastion now offers support for connecting to target VMs in Azure using a native RDP or SSH client on your Windows workstation. This feature lets you connect to your target VMs via Bastion using Azure CLI and expands your sign-in options to include local SSH key pair and Azure Active Directory (Azure AD). This article helps you configure Bastion with the required settings, and then connect to a VM in the VNet. For more information, see the [What is Azure Bastion?](bastion-overview.md).
16+
Azure Bastion now offers support for connecting to target VMs in Azure using a native RDP or SSH client on your local workstation. This feature lets you connect to your target VMs via Bastion using Azure CLI and expands your sign-in options to include local SSH key pair and Azure Active Directory (Azure AD). This article helps you configure Bastion with the required settings, and then connect to a VM in the VNet. For more information, see the [What is Azure Bastion?](bastion-overview.md).
1717

1818
> [!NOTE]
1919
> This configuration requires the Standard SKU for Azure Bastion.
2020
>
2121
2222
Currently, this feature has the following limitations:
2323

24-
* Native client support is not yet available for use from your local Linux workstation. If you are connecting to your target VM from a Linux workstation, use the Azure portal experience.
25-
2624
* Signing in using an SSH private key stored in Azure Key Vault is not supported with this feature. Download your private key to a file on your local machine before signing in to your Linux VM using an SSH key pair.
2725

2826
## <a name="prereq"></a>Prerequisites
@@ -84,9 +82,9 @@ To connect to a Windows VM using native client support, you must have the follow
8482
* Inbound port: RDP (3389) *or*
8583
* Inbound port: Custom value (you will then need to specify this custom port when you connect to the VM via Azure Bastion)
8684

87-
## <a name="connect"></a>Connect to a VM
85+
## <a name="connect"></a>Connect to a VM from a Windows local workstation
8886

89-
This section helps you connect to your virtual machine. Use the steps that correspond to the type of VM you want to connect to.
87+
This section helps you connect to your virtual machine from a Windows local workstation. Use the steps that correspond to the type of VM you want to connect to.
9088

9189
1. Sign in to your Azure account and select your subscription containing your Bastion resource.
9290

@@ -104,7 +102,7 @@ This section helps you connect to your virtual machine. Use the steps that corre
104102
> If you want to specify a custom port value, you should also include the field **--resource-port** in the sign-in command.
105103
>
106104
107-
* If you signing in to an Azure AD login-enabled VM, use the following command. To learn more about how to use Azure AD to sign in to your Azure Linux VMs, see [Azure Linux VMs and Azure AD](../active-directory/devices/howto-vm-sign-in-azure-ad-linux.md).
105+
* If you are signing in to an Azure AD login-enabled VM, use the following command. To learn more about how to use Azure AD to sign in to your Azure Linux VMs, see [Azure Linux VMs and Azure AD](../active-directory/devices/howto-vm-sign-in-azure-ad-linux.md).
108106

109107
```azurecli-interactive
110108
az network bastion ssh --name "<BastionName>" --resource-group "<ResourceGroupName>" --target-resource-id "<VMResourceId>" --auth-type "AAD"
@@ -121,6 +119,10 @@ This section helps you connect to your virtual machine. Use the steps that corre
121119
```azurecli-interactive
122120
az network bastion ssh --name "<BastionName>" --resource-group "<ResourceGroupName>" --target-resource-id "<VMResourceId>" --auth-type "password" --username "<Username>"
123121
```
122+
123+
> [!NOTE]
124+
> VM sessions using the **az network bastion ssh** command do not support file transfer. To use file transfer with SSH over Bastion, please see the section on the **az network bastion tunnel** command further below.
125+
>
124126
125127
### Connect to a Windows VM
126128
@@ -142,7 +144,30 @@ This section helps you connect to your virtual machine. Use the steps that corre
142144
az network bastion ssh --name "<BastionName>" --resource-group "<ResourceGroupName>" --target-resource-id "<VMResourceId>" --auth-type "ssh-key" --username "<Username>" --ssh-key "<Filepath>"
143145
```
144146
145-
1. Once you sign in to your target VM, the native client on your workstation will open up with your VM session; MSTSC for RDP sessions, and SSH CLI extension for SSH sessions.
147+
1. Once you sign in to your target VM, the native client on your workstation will open up with your VM session; **MSTSC** for RDP sessions, and **SSH CLI extension (az ssh)** for SSH sessions.
148+
149+
## Connect to a VM using the *az network bastion tunnel* command
150+
151+
This section helps you connect to your virtual machine using the *az network bastion tunnel* command, which allows you to:
152+
* Use native clients on *non*-Windows local workstations (ex: a Linux PC)
153+
* Use a native client of your choice
154+
* Set up concurrent VM sessions with Bastion
155+
* Access file transfer for SSH sessions
156+
157+
1. Sign in to your Azure account and select your subscription containing your Bastion resource.
158+
159+
```azurecli-interactive
160+
az login
161+
az account list
162+
az account set --subscription "<subscription ID>"
163+
```
164+
165+
2. Open the tunnel to your target VM using the following command:
166+
167+
```azurecli-interactive
168+
az network bastion tunnel --name "<BastionName>" --resource-group "<ResourceGroupName>" --target-resource-id "<VMResourceId>" --resource-port "<TargetVMPort>" --port "<LocalMachinePort>"
169+
```
170+
3. Connect and log in to your target VM using SSH or RDP, the native client of your choice, and the local machine port you specified in Step 2.
146171

147172
## Next steps
148173

0 commit comments

Comments
 (0)