Configure the local web server to allow connections to a local mobile service
This is an Azure Mobile Services topic. Microsoft Azure recommends Azure App Service Mobile Apps for all new mobile backend deployments. To get started with Azure App Service Mobile Apps, see the App Service Mobile Apps documentation center.
Azure Mobile Services enables you create your mobile service in Visual Studio using one of the supported .NET languages and then publish it to Azure. One of the major benefits of using a .NET backend for your mobile service is the ability to run, test, and debug the mobile service on your local computer or virtual machine before publishing it to Azure.
To be able to test a mobile service locally with clients running on an emulator, virtual machine or on a separate workstation, you have to configure the local Web server and host computer to allow connections to the workstation's IP address and port. This topic shows you how to configure IIS Express to enable connections to your locally hosted mobile service.
Make sure to stop the mobile service if it is currently running in IIS Express. Right click the IIS Express tray icon and click stop for the mobile service.
In a command prompt window, run the ipconfig command to look up a valid local IP address for your workstation.
In Visual Studio, open the applicationhost.config file for IIS Express. This file is located in the following subdirectory of your user profile directory.
C:\Users\<your profile name>\Documents\IISExpress\config\applicationhost.config
Configure IIS Express to allow remote connection requests to the service. To do this, in the applicationhost.config file, find the site element for your mobile service and add a new
bindingelement for the port using the IP address you noted above. Then save the applicationhost.config file.
Your updated site element should look similar to the following:
<site name="todolist_Service(1)" id="2"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="C:\Archive\GetStartedDataWP8\C#\todolist_Service" /> </application> <bindings> <binding protocol="http" bindingInformation="*:58203:localhost" /> <binding protocol="http" bindingInformation="*:58203:192.168.137.72" /> </bindings> </site>
Open the Windows Firewall console and create a new port rule to allow connections to the port. For more information on creating a new Windows Firewall port rule, see How to add a new Windows Firewall port rule.
If your test machine is joined to a domain, firewall exceptions may be controlled by a domain policy. In this case, you would need to contact your domain adminstrator to get an exemption for the port on your machine.
You should now be configured to test with IIS Express hosting your mobile service.