az network bastion rdp command does not recongize valid VM resource ID

Jeff Brown Tech 6 Reputation points

I am attempting to use the az network bastion rdp command to connect to an Azure Windows VM using the native RDP client in Windows. This feature is currently in preview.

az network bastion rdp \
  --name 'bastion-WestUS2' \
  --resource-group 'rg-bastiondemo' \
  --target-resource-id '/subscriptions/<sub id>/resourceGroups/RG-BASTIONDEMO/providers/Microsoft.Compute/virtualMachines/winserver01'

When trying to connect, the command returns "Please enter a valid virtual machine resource ID". This occurs on Windows 10 using Git Bash with Azure CLI version 2.32.0.

I can run the same command in PowerShell 7 (replacing with correct multiline characters) and I can connect just fine. This shows the resource ID is correct.

I created a GitHub issue here ( with no luck so far.

Any thoughts on what I might be missing when trying to run this in Git Bash versus PowerShell?

Azure Bastion
Azure Bastion
An Azure service that provides private and fully managed Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to virtual machines.
241 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. suvasara-MSFT 9,996 Reputation points

    @Jeff Brown Tech , I did a quick repro with Git 2.8.0 version as well with the latest version 2.35.X where I encountered the same message. But while trying with Azure CLI on windows terminal it succeeded.


    Looks like there is a Git terminal compatibility issue with few Azure CLI commands. We will work towards it.


    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    1 person found this answer helpful.