Wednesday, 21 November 2012

Accessing the Windows Azure Compute Emulator from Hyper-V, Virtual PC or the external network

Unlike IIS, the Windows Azure Compute Emulator does not listen for external requests on your network IP.  It only listens on the local loopback address  As I have found out, this is a big pain for cross browser testing because you cannot install Internet Explorer 7, 8, 9 and 10 side-by-side, so you have to either use external PCs with old browsers or create virtual machines in Oracle VirtualBox or Hyper-V with those browsers installed.

To solve this problem, you could:

  • Use AnalogX PortMapper – however, you need to remember to shut it down before the emulator starts and then start it again after it’s started… this is too much friction!
  • Create a separate IIS website listening on a different port to 80, add that as a Firewall exception and access the application externally that way – however, the drawback is that you may need to change your application architecture to run under the two different contexts.  Also #1, you have the memory overheads of having 1 + N instances of the app in memory. Also #2, you’re not testing the app in emulated conditions when using IIS – which means it’s not really a thorough test.  Also #3, it’s more friction.
  • You might find there’s a way to configure Hyper-V to use the host network connection and loopback adapter… I’m not a Hyper-V expert, but I tried and failed. Probably not possible!?

However, the best solution was totally frictionless: Just use PJS PassPort: as detailed in this other blog post: 

Hope this helps someone!  I have posted this as an answer on stackoverflow as well; hopefully this will work for everyone now!