I developed an App Console, which creates an asynchronous Server Socket. You may see a similar HERE .
I also have a common Web App, which consumes the information entered in the database by the App Console.
There has been a need to upload these applications to Windows Azure. I have searched the web and found the possibility of associating my Console App to my Web App. In this way, by creating a WebJobs associated with my web project, the Console App would be started automatically with the web project and without the need for me to rewrite it . This solution is HERE
Well, it worked in parts. The App Console has run correctly and is running, but the IP that the application uses for listening (IPEndPoint) is 127.0.0.1.
This was expected because I was using the same sample code for testing:
IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, Porta);
Consequently, when trying to send information to the Server Socket, it does not exist !!
The big question is: - How to capture the External IP that Azure is using, via the line of code, to be able to create the EndPoint and associate it to the Socket?