visual-studioazureazure-web-roles

Azure Cloud Emulator remaps ports


I have a solution that contains a website and a Windows Azure Cloud Service Project. Here is the ServiceDefinition.csdef:

...
<WebRole name="FrontEndWeb" vmsize="Small">
<Sites>
    <Site name="Web">
        <Bindings>
            <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
    </Site>
</Sites>
<Endpoints>
    <InputEndpoint name="Endpoint1" protocol="http" port="2996" />
</Endpoints>
...
</WebRole>
...

I have the web-debug settings set to: Visual Studio Development Server & Auto Assign Ports

When I run the Windows Azure Cloud Service Project, I get the following message in my General Output log: Windows Azure Tools: Warning: Remapping private port 2996 to 2997 in role 'FrontEndWeb' to avoid conflict during emulation.

It is imperative that the site run on port 2996 due to a host validation requirement.

Things I've tried:

Things I do NOT have:

Why is the Azure Cloud Emulator remapping the ports, and what can I do to prevent it from doing that?


Solution

  • The Azure Compute Emulator simulates the entire Azure fabric, including the load balancer and multiple instances. Because of this, forcing specific IPs onto the Emulator is tricky business, as the Emulator will remap the VIP (virtual IP address) to simulate the Azure platform.

    This article http://blogs.staykov.net/2013/05/windows-azure-basicscompute-emulator.html explains in detail the emulator environment.

    It sounds like you need that port to satisfy an external requirement; have you considered running your app in debug mode outside the emulator? You can launch it in a standard IIS Express instance and control the endpoints using the IIS Express .config files, and then deploy normally to Azure for production.