This article describes Getting Started with Windows Azure Mobile Service.
IntroductionWindows Azure Mobile Service is a tool that can integrated with the Windows Azure cloud. This tool will help you to connect a cloud backend to your Windows 8 application. The goal of the Windows Azure Mobile Service is to make Windows Azure the obvious choice for the Windows 8 Metro style application developer. Currently we can only use the Windows Azure Mobile Service in Metro style applications but in the near future the mobile service can also work with iOS, Android and Windows Phone.Using the Windows Azure Mobile Service, a developer can easily store structured data in the cloud that can be used for both the device and the user, to easily authenticate a user and easily communicate with the WNS (Windows notification Service) for sending Push Notification. (Toast, Badge and Tile.)Getting Started with Windows Azure Mobile ServiceAs I already mentioned the Windows Azure mobile service is a new tool that can be integrated with Windows Azure. So if we want to use the Windows Azure Mobile Service then we need to create an account in Windows Azure. Click here to sign up for a 90 days free-trial. Once you are signed-up, click the "preview features" section under the "account" tab of the http://www.windowsazure.com/en-us/ website and enable your account to support the "Mobile Services" preview. Instructions on how to enable this can be found here.
Change DB
Dynamic Schema
1. Create mobile service applicationCreating a mobile service in Windows Azure is quite easy. Log into Windows Azure with your credentials and click on the "+New" Button from the bottom-left corner. Look at the following image:Select "Compute --> Mobile Service" and then click on Create. The portal will popup a dialog box and ask you to enter a valid application name. The Azure portal asks the user to choose the database, either a new database or an existing database.New DatabaseThe "New Database" option allows the user to create a new database in a new server or in an existing server. To create a database use the following steps:Step 1: Click on the New button and create a mobile serviceStep 2: Enter a valid name and select "Create a new SQL database" from the databaseStep 3: Move to the next step by clicking on the next iconStep 4: Enter a valid database name into the Name textbox.Step 5: Select "New SQL Database Server" for creating a new server and store your new database in it.Step 6: Enter the required value and move to the nextThe user can also set a database size by clicking on the "Configure advanced database settings" checkbox. Once the user has checked this check box the portal will add one more page and wait for the user to move to the next.Click on the next icon and set the database size according to the user application. Look at the following image:A Web related application can select web edition and a business related application can select business edition but that is not mandatory.If everything is working perfectly then the Azure portal will create a brand new mobile service within 30 seconds. Look at the following image:Existing DatabaseThe user can also use an existing database in its mobile service application. Use the following steps to create a mobile service application with an existing database.Step 1: Click on the New button and create a mobile serviceStep 2: Enter a valid name and select "Use an existing SQL database" from the databaseStep 3: Move to the next step by clicking on the next icon.Step 4: Select an existing database name from the database combo box and enter the database credentials.Step 5: Press ok to create the application.If everything is working perfectly then the Azure portal will create a brand new mobile service within 30 seconds. Look at the following image:2. Quick Start PageA Quick start page provides the facility to integrate your mobile service application with the new Window 8 apps or use an existing Windows 8 app to connect your mobile service. Use the following steps for that.Step 1: Click on Mobile service from the Azure portal and then click on the mobile application that you just created.Step 2: Click on the Quick startup page if it is not opened by default; see:The Quick startup page provides a way to connect your mobile service with the Windows 8 application within 3 minutes. The Quick start page helps users to download a sample Windows 8 project or use a newly created mobile service in the existing project. Use the following steps for that.1. Click on the "Create a new Windows store app" link and read all the information carefullyGet the Tools: The user can set up a machine environment by downloading VS and the Mobile service SDK.Create a table: Create a TodoItem table for a C#/JS project by clicking the "Create TodoItem table" button.Download and run your app: Download a C#/JS project and test your mobile service.2. Click on the "Connect an existing Windows Store app" and read all the info carefully. This operation assumes you already have a Metro style application.Get the tools: Setup mobile service SDKConnect your app: select the programing language and copy the code which is shown by the portal in a Gray SquareStore data in your mobile service: This is an optional step if you don't have any other table then you can create an item table and copy and paste code in your project.The Quick start page also provides a help link to know about the Authentication and Push notification. I will explain both Authentication and Push notification later in this article.3. DashboardThe Dashboard page is designed to show the mobile service details in three formats.Graph: A graph will show the users data in a graphical format. The user can see their data by hour, day and week.
Usage Overview: It shows overall usage of the user's space. Such as memory usage, data out and CPU time.Quick Glance: It shows general info of the application and subscription info of the user.4. DataThis is the page where the user can create a table to store their data. The user can create as many tables as they want. Creating a table is very simple, just click on the create button from the bottom of the footer. The Portal opens a popup dialog box once the user hits the create button and asks the user to enter a table name and set its permission. See the following image:The user can set access permissions of the table. Mobile service provides four types of permissions for tables in general. Table contains the following tabs in it:
8. ScaleThe Scale tab allows the user to scale their Windows Azure SQL database, switching the server mode and server reserved capacity. The Scale tab provides two mobile service modes:
Note: once you have set reserved mode from the scale tab, all your mobile applications in the same region is run in reserved mode.9. LogsThe Logs page is designed to write system and script errors generated by the Windows Azure mobile service. The mobile service allows the user to define their custom business logic and they can run it on the server side. The mobile service server can accept a business login by a JavaScript function, these JavaScript functions are registered in an insert, update, delete and read operation on the table.Reference:http://msdn.microsoft.com/en-US/library/windowsazure/jj554226http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started/http://www.windowsazure.com/en-us/develop/mobile/resources/
Understanding Azure: A Guide For Developers