Pages

Men

rh

10/28/2014

Configure the local web server to allow connections to a local mobile service

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.
  1. Make sure to stop the mobile service if it is currently running in IIS Express. Right click the IIS Express tray icon and clickstop for the mobile service.
  2. In a command prompt window, run the ipconfig command to look up a valid local IP address for your workstation.
  3. 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
  4. 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 binding element 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>
  5. 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.
    You should now be configured to test with IIS Express hosting your mobile service.


Source from :
http://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-how-to-configure-iis-express/

No comments :

Post a Comment