Add opt-in/opt-out for multiple monitors on `az network bastion rdp` command
See original GitHub issueRelated command
az network bastion rdp --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId
Is your feature request related to a problem? Please describe. While connecting to an Azure resource through Azure Bastion Standard native client, generated RDP file will always use all monitors by default, which is not always desired when working with multiple screens.
Generated RDP file excerpt:
hostname:s:<serverName>
full address:s:<serverName>
alternate full address:s:<serverName>
use multimon:i:1
serverport:i:3389
gatewaycredentialssource:i:5
gatewayusagemethod:i:1
gatewayprofileusagemethod:i:1
gatewayhostname:s:<bastionPIPName>.bastion.azure.com
gatewayaccesstoken:s:<gatewayAccessToken>
signscope:s:Full Address,Alternate Full Address,GatewayHostname,GatewayUsageMethod,GatewayProfileUsageMethod,GatewayCredentialsSource
signature:s:<AuthSignature>
Describe the solution you’d like
Would be interesting to give option to administrator while connecting to bastion to opt-in or opt-out for the multiple monitor options based in a command switch (eg. az network bastion rdp --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --use-multimon
)
Describe alternatives you’ve considered
As generated RDP file comes from managed Remote Desktop Gateway, the solution would be to modify conn.rdp
in rdp_bastion_host
function to replace the integer value of use multimon
to 0 in the presence or absence of a parameter to use multiple monitors, which should be modified in src/azure-cli/azure/cli/command_modules/network/custom.py
.
As a workaround, whenever needed to use a single monitor, we can cancel connection and then replace value in conn.rdp
file as snippet below
(Get-Content .\conn.rdp).Replace("use multimon:i:1","use multimon:i:0") | Set-Content .\conn.rdp
mstsc .\conn.rdp
Additional context N/A
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:21 (3 by maintainers)
Top GitHub Comments
@davi-cruz Thanks for the feedback! Looks like the RDP file content is retrieved from an API on the service side, so we are routing this to the service team for review.
Thanks all for the feedback and @skmkzyk for the workaround! We have worked up a PR that adds support for a new flag (
--configure
) that would open up the Remote Desktop Connection UI instead of directly connecting, allowing you make changes to the session configuration.