Get started with Mobile Services
This is an Azure Mobile Services topic. This service has been superseded by Azure App Service Mobile Apps and is scheduled for removal from Azure. We recommend using Azure Mobile Apps for all new mobile backend deployments. Read this announcement to learn more about the pending deprecation of this service.
Learn about migrating your site to Azure App Service.
Get started with Azure Mobile Apps, see the Azure Mobile Apps documentation center.
For the equivalent Mobile Apps version of this topic, see Create an iOS app in Azure Mobile Apps.
To complete this tutorial, you need an Azure account. If you don't have an account, you can sign up for an Azure trial and get free mobile services that you can keep using even after your trial ends. For details, see Azure Free Trial.
Follow these steps to create a new mobile service.
Log into the Azure classic portal. At the bottom of the navigation pane, click +NEW. Expand Compute and Mobile Service, then click Create.
This displays the Create a Mobile Service dialog.
In the Create a Mobile Service page, select Create a free 20 MB SQL Database, select .NET runtime, then type a subdomain name for the new mobile service in the URL textbox. Click the right arrow button to go to the next page.
This displays the Specify database settings page.
As part of this tutorial, you create a new SQL Database instance and server. You can reuse this new database and administer it as you would any other SQL Database instance. If you already have a database in the same region as the new mobile service, you can instead choose Use existing Database and then select that database. The use of a database in a different region is not recommended because of additional bandwidth costs and higher latencies.
In Name, type the name of the new database, then type Login name, which is the administrator login name for the new SQL Database server, type and confirm the password, and click the check button to complete the process.
You have now created a new mobile service that can be used by your mobile apps.
Now that you have created the mobile service, download projects that you can run locally.
Click the mobile service that you just created, then in the Quick Start tab, click iOS under Choose a platform and expand Create a new iOS app.
On your Windows PC, click Download under Download and publish your service to the cloud. This downloads the Visual Studio project that implements your mobile service. Save the compressed project file to your local computer, and make a note of where you saved it.
On your Mac, click Download under Download and run your app. This downloads the project for the sample To do list application that is connected to your mobile service, along with the Mobile Services iOS SDK. Save the compressed project file to your local computer, and make a note of where you saved it.
The mobile service project lets you run your new mobile service locally. This makes it easy to debug your service code before you even publish it to Azure.
On your Windows PC, download your personalized server project, extract it, and then open it in Visual Studio.
Press the F5 key to rebuild the project and start the mobile service locally. A web page is displayed after the mobile service starts successfully.
In Visual Studio, right-click the project, click Publish > Microsoft Azure Mobile Services. Instead of using Visual Studio, you may also use Git.
Sign in with Azure credentials and select your service from Existing Mobile Services. Visual Studio downloads your publish settings directly from Azure. Finally, click Publish.
The final stage of this tutorial is to build and run your new app.
Browse to the location where you saved the compressed project files, expand the files on your computer, and open the project file using Xcode.
Press the Run button to build the project and start the app in the iPhone emulator.
In the app, type meaningful text, such as Complete the tutorial and then click the plus (+) icon.
This sends a POST request to the new mobile service hosted in Azure. Data from the request is inserted into the TodoItem table. Items stored in the table are returned by the mobile service, and the data is displayed in the list.
This shows how to run your new client app against the mobile service running in Azure. Before you can test the iOS app with the mobile service running on a local computer, you must configure the Web server and firewall to allow access from your iOS development computer. For more information, see Configure the local web server to allow connections to a local mobile service.
Learn how to perform additional important tasks in Mobile Services:
Get started with offline data sync
Learn how to use offline data sync to make your app responsive and robust.
Add authentication to an existing app
Learn how to authenticate users of your app with an identity provider.
Add push notifications to an existing app
Learn how to send a very basic push notification to your app.
Troubleshoot Mobile Services .NET backend
Learn how to diagnose and fix issues that can arise with a Mobile Services .NET backend.