Share via


Accessing Azure Virtual Machine IIS website publicly

Question

Wednesday, January 11, 2017 6:47 AM

Hi Team,

I have Created a IIS website in Azure VM. When i am trying to access it publicly getting below error.

**This site can't be reached. **

Below is the ways i am trying to access publicly. 

1. http://<VM RDPserver Name>:<PortName>/WebsiteName

Please let me know what is the procedure to access a VM IIS website Publicly. 

Thanks in advance. 

regards,

Manoj

All replies (10)

Wednesday, January 11, 2017 6:32 PM | 1 vote

Hello,

Thank you for posting on the Azure forums!

You will have to first open the port 80 for HTTP access to your website via the internet. To do this follow the below steps:

1-      Click on your VM in the Azure portal.

2-      Click on Network Interfaces > The IP address tab > Network Security groups > Click on the NSG that is available there.

3-      On the tab that appears click on Inbound Security rules > Add > Click on the Service dropdown and select http > Click on OK.

4-      Wait for the rule to get updated. Once done go ahead and access the IIS website via any browser using the below format.

 

http:// <DNS name of the VM>.<location of the VM datacenter>.cloudapp.azure.com

 

Example: http://webiis.eastus.cloudapp.azure.com

To setup a DNS name for your VM (if not already set) follow the below steps:

1-      Click on the VM blade in the Azure portal.

2-      Click on the Overview tab > On the left hand side under Public IP address/DNS name label click on the entry below.

3-      In the configuration tab > enter the desired DNS name for the VM in the DNS name label (optional) box. Click on Save.

4-      Once the changes take effect you should be able to use the above steps to access your website via the internet.

I hope that the reply will assist you in getting your query addressed. In case you require further assistance, please do reply to the thread as we are always available to your queries.

Regards,

Loydon

________________________________________________________________________________________________________________

 

When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer so that other customers can benefit from it.


Thursday, January 12, 2017 6:55 AM

Hi Loydon Mendonca,

Thanks for the help.

when i am trying to create Network Security groups its showing none.

There is no other option to create also.

can you please guide me for this. 

please find the below image. 

Thanks in advance


Thursday, January 12, 2017 8:35 AM | 1 vote

Hello,

Thank you for getting back to us.

It appears that this is a Classic VM you are using to setup your IIS website. Since this is the case you will have to click on Endpoints option (which is visible in your above screenshot) and then set the http port 80 as private and public port in order to open endpoints for your IIS site to be accessible over the internet.

You can also manage endpoints using the Classis portal by visiting manage.windowsazure.com and then following the instructions listed in /en-us/azure/virtual-machines/virtual-machines-windows-classic-setup-endpoints. Either ways the end result can be achieved.

Let me know if you need any further assistance on this.

Regards,

Loydon

________________________________________________________________________________________________________________

When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer so that other customers can benefit from it.


Friday, January 13, 2017 6:37 AM

Hi Loydon,

Thanks for helping once again.

i have created end point with port number 8088

You can see port no 80 is already assigned to Remote Desktop in below given image.

I have created a endpoint with port number used by me in the website inside Azure VM(8088).

Still I am not able to access the website.

Do i need to give endpoint name as same as website name or anything i am missing?

Please find the below image of the endpoint used in the VM.

Regards,

Manoj


Friday, January 13, 2017 3:57 PM

Hello Manoj,

Thank you for getting back to us.

I suggest you keep the public interface for the RDP port as 3389 instead of 80 and use port 80 as the public interface for the 8088 private port.

Check with the above and let me know if it works.

Regards,

Loydon


Monday, January 16, 2017 9:58 AM

Hi Loydon,

Thanks for helping once again.

While add public port as 80 ,

getting below error.

Regards,

Manoj


Monday, January 16, 2017 10:05 AM

Hi Loydon,

In earlier post forget to mentioned, that I have changed RDP public port, 

You can see I have changed the RDP public port as given below. but not able to change or add new end point with public port as 80 , getting the error 

Regards,

Manoj


Monday, January 16, 2017 10:17 AM

Hi Manoj,

First try to remove the endpoint for Remote desktop and then add it back again while keeping the public interface for RDP port as 3389 instead of 80 this time. Now you port 80 will be free. Now you can add new endpoint for http as TCP port 80 as public interface. This should solve your problem.

Also make sure of this points,-

1. Your website in IIS server is depolyed on port 80 and you can access it locally from VM's browser at http://localhost:80/

2. Also make sure that your VM's firewall doesn't block TCP port 80. Well, it probably doesn't but just check the same if the above solution doesn't work.

If it still doesn't solve your problem then, use the "Fiddler" tool to trace the error at the client system while requesting the website and post the same here. Best of luck.

Regards,

Sudip


Friday, February 3, 2017 11:01 AM

Hi Sudip,

I have done with modification suggested by you.

I am getting below error.

[Fiddler] The connection to< VM server name'**********'> failed. 
Error: TimedOut (0x274c). 
System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <port number>

I am accessing the website as below:

1. <VMservername>\WebsiteName>

2. <VMservername>:<VM Port Number>\WebsiteName>

2. <VMservername>:80\WebsiteName>

Note: If I am trying to ping the IP of VM machine it's not pinging in client system. 

Regards,

Manoj


Friday, February 3, 2017 11:35 AM

Ping is disabled on Azure by default for security reasons. You can only ping an Azure VM if you have a VPN connection from on premise.