Before giving the answer, here are some important concepts you should know about Azure Web App.
- Azure Web App is a sand box. The only way an Azure web app can be accessed via the internet is through the only two already-exposed HTTP (80) and HTTPS (443) TCP ports.
- For Nodejs App deployed to Azure, Azure will create a named pipe for your server to listen, and pass the request from 443 port(as you use https) to the named pipe. Specific port(even though you use 443) in your nodejs app is invalid and will cause Server Internal Error(500).
So you are supposed to use process.env.PORT instead of 8080 and access your site with the urlhttps://myapp.azurewebsites.net.
You can see the pipe if you output it in log.
More details about Azure Web App sandbox.
Besides, you can refer to this nodejs web app deploy tutorial and this app sample.