Node js deployement in Azure server could not be accesses outside using ip

I tried deploying a simple node js service in azure ubuntu using CLI,console logs says the server is up on port 8080(this same service works perfectly in my local machine),but when i tried to access the public ip from outside,it gives site can't be reached

Following was the output when i deployed my service

azureuser@myVM:~/drugdemo/user_service/drulistService$ vi server.js
azureuser@myVM:~/drugdemo/user_service/drulistService$ node server.js
App is listening on 8080
^C^C
azureuser@myVM:~/drugdemo/user_service/drulistService$ pm2 start server.js
[PM2] Starting 
/home/azureuser/drugdemo/user_service/drulistService/server.js in fork_mode (1 instance)
[PM2] Done.


 Use `pm2 show <id|name>` to get more details about an app
 azureuser@myVM:~/drugdemo/user_service/drulistService$

Please help me with your suggections. (I already tried changing 'localhost' to '0.0.0.0' and '127.0.0.1' but didn't work for me)

Thank you in advance


Solution 1:

Make sure to open the firewall port via Azure as well and not just the server.

This may help: https://blogs.msdn.microsoft.com/pkirchner/2016/02/02/allow-incoming-web-traffic-to-web-server-in-azure-vm/