Search code examples
azureazure-virtual-machineazure-vm-role

Can not access second website on azure virtual machine


I am hosting two web applications on IIS server on Azure Virtual machine (classic), But I am unable to access the second application by url.

I have two websites- One is hosted on port 80 and other is hosted on port 8081. I am able to access the site one using - http://abc.cloudapp.net, but can not access the second site as http://abc.cloudapp.ne:8081. I have added the both endpoint for VM.

Locally I am able to access both sites using url- http:://localhost and http://localhost:8081.

Can any one help me?


Solution

  • You must also open port 8081 on the local VM firewall. On the server from PowerShell.

    PS C:\> New-NetFirewallRule -DisplayName "Open Inbound Port 8081" -Direction Inbound –LocalPort 8081 -Protocol TCP -Action Allow
    

    ref: https://technet.microsoft.com/en-us/library/jj554908(v=wps.630).aspx