I have a simple MVC3 Web Role deployed to Azure.
I noticed that every minute I get this set of three error messages in the WADDiagnosticInfrastructureLogsTable:
Cannot read data from the remote connection. Closing session...
The RDP header is missing or not valid.
Cannot locate remote endpoint. Closing remote socket...
I am not connected through Remote Desktop or anything like that.
Any ideas where this could be coming from?
In your service definition do you see imports for RDP something like this
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
Also check what are the values in service configuration for RDP related setting. Just a wild guess, remote forwarder is enabled and not able to remoteaccess to the instances.
Yes, I do have those modules, and remote desktop works fine.
What puzzles me is that I see those errors all the time, no matter if I use remote desktop or not.
It does have something to do with the forwarder, though I currently have only one instance - nothing to forward here.
I caught another error message in the log table:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.Plugins.RemoteForwarder.AsynchronousStreamConnector.<>c__DisplayClass2.<ConnectStreams>b__0(IAsyncResult readResult)
This is definitely not coming from my code...
If you just wanna fix the problem and get the messages out of the diagnostic table, I think you can consider restarting remoteforwarderagent.exe and remoteaccessagent.exe.
If you are interested in finding out if there are remote connection attampts and where they come from, a network sniffer like network monitor should give you some idea--setup that on the VM and let it run for a while, then analyze the captured network traffic to see if there are rdp related packages there.