Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get Azure Virtual Machine to serve websites

I've just set up a windows azure VM and installed IIS on it.

When I remote desktop onto the box I can see the default IIS website fine but I can't get this to serve on the web from the IP address of the box.

I've opened up port 80 on windows firewall and also added an endpoint for port 80.

I've tried to access it with the firewall completely turned off also but to no avail...

I cant work out if there is anything else I need to do to get this working?

like image 839
Andy Roper Avatar asked Oct 25 '13 09:10

Andy Roper


People also ask

How do I set up a web server on an Azure VM?

To configure it as webserver, first you need to install IIS, you can do it by Remote Desktop to the machine and install IIS from Programs and Features. Once it completed, you need to add exception in firewall to allow incoming / out going traffic. Now you have completed the configuration in Virtual Machine.


1 Answers

  1. Add endpoints for port 80 (http) and port 443 (https) to the VM in the Azure portal (tip: this can be automated with powershell or the Azure cli).

  2. Remote desktop to the machine. Open the Windows firewall control panel and allow traffic to port 80 (http) and port 443 (https) or just turn it off ... the firewall is ON by default (tip: can also be scripted through the VM agent / powershell).

  3. Go to the Azure portal and find the cloudapp.net subdomain for your VM (actually the cloud service) your VM is running under. Try accessing the site with that domain. If that doesn't work, try browsing to http://localhost on the server (remote desktop) to make sure IIS works and troubleshoot from there.

  4. Modify the DNS records of your custom domain to use a CNAME to the .cloudapp.net domain. If you need A records make sure to use the public IP of the cloud service (just ping the .cloudapp.net domain to find it or look in the Azure portal).

You might want to look into Azure Websites or Azure Cloud Services (web roles). Those are a lot easier to manage and a lot cheaper. They still offer most of the functionality.

like image 145
Steven De Kock Avatar answered Sep 28 '22 10:09

Steven De Kock