Getting Started with Windows Azure Mobile Services
This is a translation of the official guidelines for creating and using Windows Azure Mobile Services.About what it is, you can read in the announcement here .
This post will show you how to add cloud support for your application for Windows 8 using Windows Azure Mobile Services. In this guide, you will create a new mobile service and a To-do list application that will store your data in the cloud.
')
This tutorial is key to successfully completing the remaining Mobile Services guides.
Creating a new mobile service
In order to create a new instance of the mobile service, you need to do a few simple steps:
At the bottom of the page, locate the large button labeled + NEW :
Select Mobile Services , then Create . A wizard for creating a new mobile service will open:
On the first page of the wizard, you need to select a name for the subdomain for the new mobile service. Each text entry in this field will check the availability of your chosen name dynamically. After you select an available name, go further by clicking on the arrow below:
Note
In this example, we are creating a new database. You can continue to use it for a different purpose and administer it in the same way as other database instances. If you already have a database in the same region as the new mobile service, you can use it instead of creating a new one. Using the database in another region is not recommended due to possible bandwidth problems.
In the next wizard window we need to specify the database parameters: name, administrator login and password:
Note
If the administrator password does not meet the minimum security conditions, or the passwords do not match, a warning will be displayed. We advise you to keep credentials for this database in case of reuse.
After completing these points, you will create a new instance of mobile services, which you can use in your application for Windows 8.
Creating a new application
After you have created a new mobile service, you can use quick links to create a new or modify an existing application for Windows 8. In this section, we will create a new application that will interact with your cloud-based mobile services.
In the management portal, select Mobile Services , and then select the service we just created.
On the Quick Start tab, expand the Create a new Windows 8 application option :
You will be presented with three simple steps to create a new application for Windows 8 connected to cloud services:
After installing VS2012, select the Create TodoItems table option to create a new table to store application data.
In the Download and run application section, select your preferred language (C # or JavaScript), then click Download . From this link, you can download the To-do list application configured on your own mobile service. Save the archive with the application on your local computer.
Running a Windows 8 application
The final stage of this guide is to build and run our new application.
Unzip the archive you downloaded in the previous section and open the project in Visual Studio 2012 Express for Windows 8:
Press the F5 key to build and run the application.
In the application that opens, enter any records, for example, Explore Windows Azure , in the Insert a TodoItem field , and then click the Save button: Clicking on the button will trigger a POST request to the previously created mobile services located in the Windows Azure cloud. The data passed in this query will be inserted into the TodoItem table. All data stored in this table will also be returned by the mobile service and displayed in the right column of the application.
Note
You can view the code that is responsible for accessing cloud services in the MainPage.xaml.cs file (for C # / XAML projects) or the default.js file (for JavaScript / HTML projects).
Return to the Windows Azure Management Portal and go to the Data section of your new mobile service. Next, click on the TodoItems table:
In the window that opens, you will see the data stored in this table:
What's next
After you have completed this tutorial, learn how you can accomplish additional important tasks with Mobile Services:
Work with data More information on how to store and retrieve data using Mobile Services
Work with users Learn how to authorize users of your application using Windows Account.
Work with push notifications Learn how to send basic push notifications to your application.