The problem

I recently stumbled on a problem which took me about 2 hours to realize but was easy to fix.

I created a Cloud Service in Visual Studio 2013 Update 2 with a MVC Role, used IIS Express and full Azure Storage Emulator for my project.

Steps began when I tried to add Windows Azure Active Directory to authenticate my app through this service. One of the steps was adding HTTPS/SSL for my app. After setting “SSL Enabled” value to true in my MVC project, VS generated an SSL URL. I debugged the solution and realised that the URL doesn’t work — with a generic error “Cannot display the webpage”.

The root cause was a DNS binding conflict between IIS Express and the Cloud Service emulator. When running a Cloud Service project locally, the compute emulator configures its own bindings that can clash with the SSL URLs generated by Visual Studio for IIS Express.

The solution

The fix involved ensuring the SSL port assigned by Visual Studio wasn’t conflicting with ports already reserved by the Azure Compute Emulator, and updating the IIS Express applicationhost.config to include the correct HTTPS bindings.