Reputation: 530
The Remote Desktop ActiveX does not react to the connect command when using connection parameters to connect to azure VM. The ActiveX window stays white instead of showing the remote desktop session initialization. How to correctly use the Remote desktop client ActiveX to connect to Azure?
.RDP file sample
full address:s:<cloudservice>.cloudapp.net
username:s:<username>
LoadBalanceInfo:s:Cookie: mstshash=<role>#<roleinstance>
I use ActiveX embedded in a WPF WindowsFormsHost. (I already tested with another LAN Pc and remote session is established successfully. (Server, username, and password provided).
<WindowsFormsHostEx x:Name="m_host" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
FlowDirection="LeftToRight">
<axMstscLib:AxMsTscAxNotSafeForScripting x:Name="m_remoteDesktop"/>
</WindowsFormsHostEx>
When trying to embed theses informations into the ActiveX. the command does not react. connected value stays to "2"... and no OnConnected, OnDisconnected, OnFatalError, OnLogonError occured.
m_remoteDesktop.Server = "<cloudservice>.cloudapp.net";
m_remoteDesktop.UserName = "<username>";
IMsRdpClientAdvancedSettings settings = m_remoteDesktop.AdvancedSettings as IMsRdpClientAdvancedSettings;
if (settings != null)
{
settings.LoadBalanceInfo = "Cookie: mstshash=<Role>#<RoleInstance>";
settings.ClearTextPassword = "<rdp pass>";
}
m_remoteDesktop.Connect();
short connected = m_remoteDesktop.Connected;
Upvotes: 1
Views: 870
Reputation: 530
settings.LoadBalanceInfo need a "\r\n" at the end to be effective.
settings.LoadBalanceInfo = "Cookie: mstshash=<Role>#<RoleInstance>"
to
settings.LoadBalanceInfo = "Cookie: mstshash=<Role>#<RoleInstance>\r\n"
Just adding that made my problem solved.
Upvotes: 3