AzureAdventures: Cannot Create Mobile Service Error 500

When you try to create an azure mobile service, based on an existing Azure database, you could get the following error message:

image

The following mobile service was not created: ‘asdfasdfasdfasdf’. Error 500

And in the details:

{"message":"Please try again. If the problem persists, 
contact support.","ErrorMessage":"Please try again. 
If the problem persists, contact support.",
"httpStatusCode":"InternalServerError",
"operationTrackingId":"","stackTrace":null,"Padding":null}

The problem is that Azure cannot create the mobile service because the database is not accessible.

  1. Make sure the credentials to your DB are correct
  2. Enable access from Azure to your DB:

Go to SQL Databases and into the details of your instance. Open the Dashboard and click “Manage allowed IP Adresses”:

image

In that window, under ALLOWED SERVICES, set WINDOWS AZURE SERVICE to YES:

image

Create your mobile service again and it should work.