scooterlord scooterlord - 14 days ago 9
Linux Question

Azure - can't access VM from public ip

I created a basic Linux VM machine; I can connect properly using SSH. I have already added http port 80 and https port 443 on the network rules but still can't access the machine from the browser using its public ip. The machine is running nginx.

I have tried dissociating and associating a new ip, with no luck, removing and re-adding rules with no luck.

I then created a new VM but instead of using a Basic VM I added a Standard VM and the only other difference is that I didn't enable the hi-avail option. I connected through ssh, added nginx, added the inbound rule in the network security group (http:80) and I can properly access it through the browser.

A lot of work has been done in the first VM before realizing that we can't access it through the browser, so it is not easy to do all the work from scratch. Here are my questions:

a) What could I be doing wrong so that access from the browser is not allowed? Here is a screenshot of my network security group:
enter image description here

b) Could the hi-availability option (hi-avail) cause the problem? I am afraid to delete it in case the VM stops working. bb) Can I delete this without issues?

c) Is there a way to transfer everything from the basic (hdd) VM to a standard (ssd) VM?

edit: concerning c) The reason I wanted to transfer was to change hardware, but it seems like it was easier than I thought. I just entered the VM 'Size' and changed CPU-RAM and concerning the HDD to SSD, on a stopped VM, I entered the disk and changed to Premium. That's about it.

Thank you in advance for your time. :/

Answer

According to your description, this web service listening on port 8080, so we should add inbound rules in NSG, then use port 8080 to test it.

Could the hi-availability option (hi-avail) cause the problem? I am afraid to delete it in case the VM stops working.

As far as I know, in Azure resource module, we can't delete it.

Is there a way to transfer everything from the basic (hdd) VM to a standard (ssd) VM?

If you want to resize VM from basic to standard, we should copy VHD to SSD storage account, then use this VHD to create a standard VM. We can use Azcopy to do this.

After VHD copy complete, we can use PowerShell or template to create new VM.