开发者

How to force open webrole on port 80 in azure dev fabric(azure sdk 1.5)

开发者 https://www.devze.com 2023-04-11 22:33 出处:网络
Recently, I upgraded my dev env from ver1.1 to ver 1.5 of the Azure SDK (I know - ama little too late :))

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 o开发者_运维知识库pening 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


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


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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消