I use "flask run -p 80" to start a python web api in Azure ubantu 22.
I use curl to test it successfully in VM
I also add security rule for azure NSG, it test successfully.
But I can not access the flask 80 portal use my local browser. Please help to advice what i need to do next? Thanks so much!
How to access Azure ubuntu http 80 port? I have followed the methods below to run the application on
port 80
in theUbuntu VM
Note: For testing I deployed NGINX
Check if your application is listening on the correct port 8080
for the foreign Address 0.0.0.0:*
by using below command. If not, you could find what's IP of the application consumed.
#Install nettools
sudo apt install net-tools
sudo netstat -alpn | grep LISTEN
Output:
When I try with 8080
, it's not working, but it's working with 80 as below.
NSG Rules
Make sure to add the same port in the NSG
as the port that is listening on the VM
When I try to access the application hosted on the Ubuntu VM using the public IP
with port 80
, it starts working as below.
20.56.41.235:80
If still not working disable the local firewall on Ubuntu VM
by using the command below.
sudo ufw disable