Azure Virtual Machine can’t serve websites

azurenetworkingvirtual-machines

I am unable to get an Azure VM running Windows Server 2012 to serve up the IIS default website from it's public static IP.

  1. Created a VM running Win Server 2012 R2 and installed web server role.

  2. Browse to localhost and can see the default website is working

  3. In Azure, configured the VM to have a Public Static IP address and added DNS name to azure which is publicly resolving to the static IP.

  4. In Azure, configured a Security Group for the VM network interface and added the following rules:

    allow-http    source: any    source port: 80    dest: any    dest port: 80    service: tcp/80    action: allow
    allow-https    source: any    source port: 80    dest: any    dest port: 80    service: tcp/443    action: allow
    
  5. In Windows Firewall settings, made sure the rules to allow HTTP and HTTPS traffic are enabled. (I have also tried disabling the firewall entirely).

  6. In IIS make sure the default website is bound to any IP address.

When I try to connect to the VM static IP address, e.g.: http://MY.PUBLIC.STATIC.IP, I cant connect at all. I can't PING the server either.

Any ideas on what I am doing wrong?

Best Answer

You are limiting incoming connection to port 80 only. Client browsers can use a port number ranging from 1024 and 65536 for their outgoing connection.

You need to change your security group settings to allow incoming connections from Any port:

allow-http    source: any    source port: any    dest: any    dest port: 80    service: tcp/80    action: allow
allow-https    source: any    source port: any    dest: any    dest port: 80    service: tcp/443    action: allow