Question

After updating azure SDK to 1.8 I'm not able to run our project properly anymore. Looks like local emulator creates IIS application in a wrong way using the same port numbers. The problem can be reproduced if I just create a new Cloud project with say 5 web roles, then set Use IIS Web Server in Azure project properties Azure project properties

After running an application IIS shows that most of them are stopped because the same port is already in use. All of them uses 8085 port which must be assigned to the last app only

enter image description here

enter image description here

Bug reported to Microsoft: http://connect.microsoft.com/VisualStudio/feedback/details/773786/azure-sdk-1-8-binds-several-web-roles-to-the-same-port-on-local-emulator#details

Default Visual Studio service configuration which doesn't work with SDK 1.8

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
  <WebRole name="WebRole1" vmsize="Small">
    <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>
  </WebRole>
  <WebRole name="WebRole2" vmsize="Small">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="8080" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
    </Imports>
  </WebRole>
  <WebRole name="WebRole3" vmsize="Small">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="8081" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
    </Imports>
  </WebRole>
  <WebRole name="WebRole4" vmsize="Small">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="8082" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
    </Imports>
  </WebRole>
  <WebRole name="WebRole5" vmsize="Small">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="8083" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
    </Imports>
  </WebRole>
</ServiceDefinition>
Was it helpful?

Solution

Same problem was posted here: Only one instance works with Azure October 2012 SDK on IIS7.5

I ran into this with the same setup, tried everything logical to resolve, searched the web... nothing. I don't understand how this could be. Same project ran fine on an older version of Azure Emulator. Thanks MS.


UPDATE: I RESOLVED my issue following the suggested Registry hack here:

Strange behavior of Windows Azure Compute Emulator (SDK 1.8) with multiple role instances on a clean machine with VS2012 but WITHOUT VS2010

It appears that the issue is the emulators confusion selecting settings for VS2010 vs VS2012. In my case, I have both 2010 and 2012 installed, but it appears to affect you even with a clean install of 2012 only.

Microsoft.WindowsAzure.Common.Workarounds.TryGetVS2010SPVersion (name alone) looks like a hack, and it needed an additional reg hack to fix it. Again, thanks MS. :)

Anyone with this issue, please pile onto this connect bug for MS to fix: https://connect.microsoft.com/VisualStudio/feedback/details/773786/azure-sdk-1-8-binds-several-web-roles-to-the-same-port-on-local-emulator

OTHER TIPS

Do you have different endpoints set on each of your roles in your cloud project? If not I would hope that resolves the issue. Here is a basic blog post for how to do this:

http://robindotnet.wordpress.com/2012/07/02/how-to-set-up-an-https-endpoint-for-a-windows-azure-web-role/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top