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

Jeff Brown Tech 6 Reputation points
2022-01-22T04:24:51.807+00:00

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 (https://github.com/Azure/azure-cli/issues/21056) 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
    2022-02-01T08:19:11.17+00:00

    @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.

    170085-image.png

    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.