Our application relies on the client program running on VM to send out periodic keep-alive UDP messages to the server side on the Internet to maintain the session state. The client notifies the server of the local UDP port so the server can cross-reference the session. We are aware that Azure's Network Address Translation (NAT) may remap port numbers between the public and private sides, and think that setting up VM endpoint for the port should fix it. But it doesn't. For example, we predetermine the UDP port 55550 as the keep-alive message source port. Then we configure endpoint UDP port mapping 55550 between the private and the public on the VM. However, when the client sends messages from VM local UDP port 55550, the server side sees them coming from source UDP port 1024. It appears the endpoint doesn't take effect in this outbound-only scenario. (Did we do something wrong?)
Given that this kind use of local UDP port appears legitimate, (e.g. RTSP does it), we would like to know whether there is a solution to it.