none
How to force open webrole on port 80 in azure dev fabric

    Question

  • Recently, I upgraded my dev env from ver1.1 to ver 1.5 of the Azure SDK (I know - am  a little too late :))

    What I noticed was that my webrole was opening up at the port 81 always. Is there a way for me to force open the azure webrole on port 80 in my dev env?

    The reason I need this is :

    1. I have a browser extension which connects to my webrole - and it expects the webrole to be on port 80; Until now, testing on the dev env was easy - I just need to do an etc/host redirection and my regular browser plugin would connect to my dev fabric. 

    2. On my website, I also provide open-auth authentication from google/facebook. I would not be able to test that on my dev env if I access it as www.mywebsite.com:81/ instead of www.mywebsite.com

     

    Anyone has a pointer?

     

    Kapil

    Tuesday, October 11, 2011 6:11 AM

Answers

  • Hi Kapil,

    I did the following on a machine with SDK 1.5.20928.1904 and successfully enabled my web role to be run on port 80 in emulator:

    1. In your web role's Endpoints settings, specify 80 in the Public Port.
    2. Open IIS Manager, select Default Website.
    3. In the "Actions" panel, select "Bindings...".
    4. In the Site Bindings dialog, change the default port 80 for http to something else.
    5. Restart the "Default Website".
    6. Verify using NetStat command to make sure 80 is no longer being used.

    Now back to Visual Studio and F5 your project, the web role should be run on port 80.

    Some more information you might want to know: Overview of Locally Running a Windows Azure Application

    Regards,


    Jay Wang
    SDET
    Windows Azure Tools for Microsoft Visual Studio

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, October 12, 2011 1:01 AM
    Moderator

All replies

  • Hi Viv_ag,

    First make sure that you stop all the websites running on port 80 from IIS. Generally Default web site runs on port 80. So stop it from IIS management console.

    Then open properties of your web role project. Select Web option from left hand panel. Under radio button labeled as "Use Visual Studio Development Server" you will see another radio button labeled as "Specific Port". Select this radio button and mention 80 in the textbox opposite to it.

    Then run your application cloud project. This will open your web role on port 80. URL will be - http://127.0.0.1/

    Hope this helps.

    Regards,

    Kunal


    Mark As Answer if it helps you | My Blog
    Tuesday, October 11, 2011 6:57 AM
  • Kunal,

     

    I stopped the default website from my IIS manager, but I still see this entry when I doa  'netstat -ab':

     

      Proto  Local Address          Foreign Address        State
      TCP    0.0.0.0:80             ComputerName-PC:0         LISTENING
     Can not obtain ownership information

     

    When I restart my webrole via VS2010, it again starts on port 81. Please note that I am on sdk version 1.5

     

    Has anybody been able to run their webrole in the dev-fabric emulator on port 80? If yes, please let me know.

     

    Thanks

    Kapil

    Tuesday, October 11, 2011 11:30 AM
  • Kapil,

    I stopped default web site on port 80. I did not change the specific port in web role project properties. Then I found that web role starts on port 81.

    So just make sure that, you are changing properties of web role project to run on port 80.

    The steps have mentioned in above post as follows -

    "Then open properties of your web role project. Select Web option from left hand panel. Under radio button labeled as "Use Visual Studio Development Server" you will see another radio button labeled as "Specific Port". Select this radio button and mention 80 in the textbox opposite to it."

    Hope this helps.

    Regards,

    Kunal


    Mark As Answer if it helps you | My Blog
    Tuesday, October 11, 2011 11:42 AM
  • Kunal,

     

    I did the specific change you mentioned in your post - i.e specified the port as 80; and it still doesnt work. Which sdk version are you on? Also, I am trying to start the whole of the cloud-service and not just the webrole specifically.

     

    Thanks

    Kapil

    Tuesday, October 11, 2011 12:35 PM
  • Hi Kapil,

    I did the following on a machine with SDK 1.5.20928.1904 and successfully enabled my web role to be run on port 80 in emulator:

    1. In your web role's Endpoints settings, specify 80 in the Public Port.
    2. Open IIS Manager, select Default Website.
    3. In the "Actions" panel, select "Bindings...".
    4. In the Site Bindings dialog, change the default port 80 for http to something else.
    5. Restart the "Default Website".
    6. Verify using NetStat command to make sure 80 is no longer being used.

    Now back to Visual Studio and F5 your project, the web role should be run on port 80.

    Some more information you might want to know: Overview of Locally Running a Windows Azure Application

    Regards,


    Jay Wang
    SDET
    Windows Azure Tools for Microsoft Visual Studio

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, October 12, 2011 1:01 AM
    Moderator
  • Jay,

     

    Thanks for the post. I tried to follow what you've mentioned, but it still didnt work. Here are the details:

     

    1. I confirmed that the webrole's endpoint has 80 in the public-port:

        <Endpoints>

          <InputEndpoint name="HttpIn" protocol="http" port="80" />

        </Endpoints>

     

    2. I made the DefaultWebsite's binding top port 100. I restarted the default-website after this

     

    3.  After restarting, when I netstat I see both port 80 as well as port 100 as alive. I wait for sometime, but the port 80 is not getting free:

      Proto  Local Address          Foreign Address        State

      TCP    0.0.0.0:80             Surfmark1-PC:0         LISTENING

      TCP    0.0.0.0:100            Surfmark1-PC:0         LISTENING

     

    4. If I shutdown the defaultwebsite - the 2nd entry (for port 100) goes away from the netstat, but the port 80 still sticks around.

     

    Thanks

    Kapil

    Wednesday, October 12, 2011 6:27 AM
  • Jay,

     

    I tried out your solution on a different machine and it seems to work. So, there seems to be some problem on my local machine. I will try to solve it on my own. But atleast I know the solution! Thanks again for the answer!

     

    Kapil

    Wednesday, October 12, 2011 9:53 AM
  • You're welcome.

    One thing just popped up: sometimes there are other software that will use port 80 for other purposes - for example, Skype will use 80 if some firewall settings doesn't allow it to use other ports.

    There are also Microsoft tools (like Sysinternals) and 3rd party tools that can help you to find out who's using the port.

    Regards,


    Jay Wang
    SDET
    Windows Azure Tools for Microsoft Visual Studio

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, October 12, 2011 11:06 PM
    Moderator
  • Jay,

    I am now able to solve the issue on my system. I think what triggered the issue was that I had used Microsoft Web Platform installer to install a few things. That triggered open a "Web Deployment Agent Service" on my system that was eating up the port 80 all the time. I kill that service and everything is fine.

     

    You can refer this thread for more details - http://stackoverflow.com/questions/1430141/port-80-is-being-used-by-system-pid-4-what-is-that/5735736#5735736

     

    Thanks

    Kapil

    Thursday, October 13, 2011 5:56 AM