Skip to main content

RDP through bastion on Azure

This is for Windows only

  1. login first and choose the right account
az login
  1. RDP through bastion
az account set --subscription "connectivity-prod-001"
$vm="vm-win10"

$rg="RG-NETBOX-DEV-001"
$subs="egl-infraops-dev-001"
$bastion="egl-aue-connectivity-prod-bastion01"
$b_rg="EGL-MGMT-CONNECTIVITY-INFRA-RG01"

$vm_id=$(az vm show --resource-group $rg --name $vm --query 'id' --subscription $subs)
az network bastion rdp --name $bastion --resource-group $b_rg --target-resource-id $vm_id --enable-mfa --configure

or using the IP for the connection

$ip = "..."
az network bastion rdp --name $bastion --resource-group $b_rg --target-ip-address $IP --enable-mfa --configure