Dave
Dave

Reputation: 1935

How to setup a fixed port for a local debug environment in Azure Emulator

I have some smoke and UI tests that I can run when my web and worker roles are deployed to azure but I would like to do the same on my local computer when I am developping. The problem is that I don't know how to force the ip:port of the the web role deployed . Any idea ?

Upvotes: 1

Views: 1774

Answers (2)

A-Trac
A-Trac

Reputation: 1

I was getting the same error, and changing the port didn't fix it. It turned out that another process was causing the issue. Another user had a disconnected session on the machine that I was using, and he had a process running that was called "csmonitor.exe", with the description "Windows Azure Simulation Monitor". I killed that process, and then I was able to debug.

Upvotes: 0

Gaurav Mantri
Gaurav Mantri

Reputation: 136366

Windows Azure Compute Emulator picks up the IP addresses from DevFC.exe.config file in C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devfabric folder. The setting names for IP address range are VipPoolStartIPAddress and VipPoolEndIPAddress. When a service starts in the emulator, the emulator service picks up 1st available IP address from this range. If you're working with just one cloud service, you can set the value in both of these settings as the same IP address and your cloud service will pick up that IP address only.

As far as port is concerned, by default it runs the cloud service on port 80 (and then dynamically switches it to port 81 to avoid port conflict). You could specify another port in your cloud service csdef file under Enpoints section. For example, in our case we always wanted the service to run on port 1001 and we have this setting:

<Endpoints>
  <InputEndpoint name="Endpoint1" protocol="http" port="1001" />
</Endpoints>

Two things to remember:

  • Once you change the setting in DevFC.exe.config, you will need to restart compute emulator for this setting to take effect.
  • These settings are reset when you install newer version of SDK so you would need to change the settings in DevFC.exe.config file after you install a newer version of SDK.

Upvotes: 6

Related Questions