1

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

Kapil
  • 572
  • 1
  • 5
  • 23

4 Answers4

0

If you are using emulator - this will be an issues, cause it opens first free port.

If you will host your role on azure, you can configure your port in config file.

For example , in this configuration:

<WebRole name="TestApplication1">
<Sites>
  <Site name="Web">
    <Bindings>
      <Binding name="Endpoint1" endpointName="Endpoint1" />
    </Bindings>
  </Site>
</Sites>
<Endpoints>
  <InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
  <Import moduleName="Diagnostics" />
</Imports>
<ConfigurationSettings>
  <Setting name="MyCustomSettingInAzure" />
</ConfigurationSettings>

You can see that for endpoint1 we configured port to use with number 80.

Update:

I've searched a bit, and found this post: http://social.msdn.microsoft.com/Forums/en/windowsazuredevelopment/thread/ae2df7e0-5005-4bcd-8b69-bb53323eb589

There are some ideas which i believe can help you. It will require adding some commands to your pre-build actions.

One more update

Please run command : Netstat -a -n -o This will show who is using port 80

dimko1
  • 872
  • 7
  • 15
  • dimko1, are you suggesting I cannot achieve this on the dev-fabric emulator? When I deploy my app on azure - the webrole listens on port 80 itself, but when I start it on my dev-fabric, it always starts on port 81. The forum post you have mentioned above is related to properly cleaning the devfabric before starting the webrole in debug again. – Kapil Oct 11 '11 at 11:36
  • yeah. as it was told on dev fabric first open port will be used. So, ensure that port 80 is not used before start ov dev fabric. I suppose you have some web applications which are already using this port – dimko1 Oct 11 '11 at 12:19
0

Just make sure port 80 is available. The compute emulator takes the port you asked for or the first available port above that.

user94559
  • 59,196
  • 6
  • 103
  • 103
  • Steve, I tried to clean up port 80, by setting my Default Website on IIS to bind to a different port. But that also doesnt clean port 80. I am discussing this thread in detail over here as well - http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/5447f16e-2eed-4170-9771-17c7c9e7e570?prof=required – Kapil Oct 12 '11 at 06:36
  • Would be great if you can also take a look at the social msdn theread – Kapil Oct 12 '11 at 06:37
  • the issue has been solved - details in http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/5447f16e-2eed-4170-9771-17c7c9e7e570?prof=required – Kapil Oct 14 '11 at 05:39
0

If you can't force it to use port 80 in stead of port 81 in your development environment even if it the port is available, then you could install Fiddler2 and try to add the following Fiddler rule at the bottom of OnBeforeRequest():

// Windows Azure force socket 80
if (oSession.host == "app.dev.com:81") { oSession.host = "127.0.0.1:80"; }
if (oSession.host == "127.0.0.1:81") { oSession.host = "127.0.0.1:80"; }
if (oSession.url == "127.0.0.1:81") { oSession.url = "127.0.0.1:80"; }

I haven't tested it, but I think that could give you a pointer of how to do it.

0

Okay - the issue has been solved. Please see this thread for more details.

http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/5447f16e-2eed-4170-9771-17c7c9e7e570?prof=required

Basically I pointed my default site in the IIS to point to a different port and that worked

Kapil

Kapil
  • 572
  • 1
  • 5
  • 23