Configuring multiple websites in IIS on a Windows Azure Virtual Machine using EndPoints

Windows Azure is a great environment for developers and companies alike due to the fact that it gives so much for so little. Apart from the 10 free websites, you get a free* Virtual Machine and a large number of other services like storage, SQL Server etc.

I’m currently using the VM option to deploy and test a number of client websites without the need to use the client’s servers. Instead, I use the VM as my staging-demo environment and once all the testing is complete and the client is happy, I then deploy to the live environment.

One of the issues I had to overcome was the fact that the VM comes with only one IP address. As such, if I want to deploy multiple website under the same domain name, I have to use the only option available and this is EndPoints.

This way, I have the ability to deploy numerous websites that run side by side as long as they use different ports. Below is a step by step description on how to set this up.

Step 1 – Configure IIS

First step is to deploy the website in IIS. Once deployed, on the right hand-side in IIS there is an option to edit the site’s Bindings. Click on this and highlight the first entry on the new window. By default the site will be configured to use port 80. Since only one site can run at that port and I assume you already have the default or another site running on port 80, you need to change the Bindings for the new site. Highlight the line and select Edit from the right-hand site options. Change the port to any number above 1000 (The first 1000 are typically reserved for Windows Applications). In our example, we will use port 8080. Save the changes and close down the window. In IIS, on the right hand side you should now be able to see the option: Navigate to localhost:8080 for your new site. Click on this to ensure that the site now can be reached on the new port.
This is step 1 done!

Step 2 – Configure the Windows Firewall

You need to add the new port to the Firewall rules to ensure that traffic will not be blocked. To do this, open the Firewall settings and go to Advanced Settings. Click on the Outbound rules (left hand side) and then select Add from the right-hand side to add a new rule. Add the protocol (in my case 8080) to the rules and save. Then select Inbound and again add a rule for the same protocol.

Step 3 – Configure the VM’s bindings

You now need to log in to the Azure Portal and navigate to the Virtual Machine’s option. Go to the EndPoints section:

EndPoint Picture

Click on the Add button at the bottom:

Add EndPoint

Configure the new EndPoint with the correct inbound and outbound ports ( I chose the same for inbound and outbound) and click on Save.

EndPoint Configuration

Give it a few minutes for the changes to be configured and propagated.
This is step 3 done!

Step 4 – Test the new settings

Navigate to your new site from your browser (outside the Virtual Machine) to test that your site is reachable. The url should look something like this:

Happy Coding...

  • Share this post on