Manage Azure Mobile Services: Part One

What is Azure Mobile Services

Azure Mobile Services is one of the Windows Azure features, Windows Azure provides many features like Virtual Machine, Cloud Services, App Services, SQL Databases, etc. Window Azure mobile services client libraries are available in many platforms, and can be used on IOS, Android, Windows Phone, Windows Store Apps.

Azure Mobile Services has many advantages:

  • You can manage tables for storing data of the apps easily.
  • Easy to connect scalable cloud backend to your mobile app.
  • Push Notifications
  • You can easily store structured data in the cloud.

Storing Data in the Cloud

Storing Data in the Cloud with Windows Azure Mobile Services is very easy for clients. Whenever we are going to create Mobile Service, it automatically takes the SQL Database inside Windows Azure.

windows azure

Firstly, I need to create server and database for our Mobile Service, where I can save my information of the application.

For creating SQL Database in azure, first of all I need to create a server for the database, where I can manage multiple databases.

For this, follow the simple steps:

Step 1: Login to Windows Azure.

Login

Step 2: In “All Items” panel, go to the “SQL Databases” and click on it.

Step 3: Create a server, select “SERVERS”.

Step 4: Click on “Add” button at the bottom of the page.

You can see there are many servers in the following figure, but I’m going to create a new one.

Add button

Step 5: Give the login name, what you want to like, I have given “Nitin” for the SQL login used to authenticate to the server.

Step 6: Create password for the server, and confirm password.

Step 7: Select appropriate “Region”.

Step 8: Click on check button.

Region

You can see it is going to create a new server.

going to create a new server

When it is going to create it will ask to enable SQL auditing firewall settings for the current server.

Click on “Enable Now” to enable the settings. (In rectangle, check mark)

Enable Now

In the next page, I need to enable default auditing settings, like storage account, table name, and storage access key.

Click on “Save” button to save the current settings.

Click on Save button

After clicking on save button, it will give message for saving stream.

clicking on save button

So, our server has been created successfully, and is ready for use.

Now, I need to create a database, go back to the servers and select current server.
Click on “New” button to create a new database.

create a new database

Go to Data Services, SQL Database, then Custom Create.

I going to choose “Custom Create”, where we can decide whether to use an existing server or create a new one.

choose Custom Create

Now, fill all the details for creation of the database.

Give the name to database, which you want to create, I have given “StudentDemo”, select “Service Tier” and then the server name.

Click on check button to create database.

Note: If you are going to create a server and want to give the name to server like “Nitin”, so it will create a default name to server, like “Nitin” to “plq4stu4ut”.

create a default name to server

You can see, the creation of database is on processing.

Now, I have successfully created database “StudentDemo” and named with server “Nitin”.

StudentDemo

Now our, Server and Database is ready for use. Now, I’m going to create a Mobile Service.

Click on “Mobile Services”, we still don’t have any Mobile Services. Click on to “New” for creating a Mobile Service.

creating a Mobile Service

Click on to COMPUTE, MOBILE SERVICE, then CREATE.

Create Mobile Service

Give the Name for your Mobile Service and for the database. Here, I’m going to select existing database, which I just created.

Name for your Mobile Service

Select your “Region”, where you want to create your Service.

Backend provides two options for the use, .NET and JavaScript; these options generate APIs for performing operations on the backend table data.

Click on next arrow.

Click on next arrow

Specify the Database Settings; select your database, Login Name, and Password.

Click on to check button.

Click on to check button

After clicking on check, you will find Mobile Service will be created as in the following screenshot and is ready for use.

clicking on check

Click on your Mobile Service, you will find more things for the service.

This page provides information about the platform for consuming the Mobile service. We have options like iOS, Windows, Android, HTML/JavaScript, etc. The portal provides a ready App for guiding us through the use of Mobile Services. On the top of the page, we have options to create Logs, Identity, Scheduler, PUSH configuration, the Host configuration, etc.

So, under the “Choose A Platform”, expand the “Create A New Windows or Windows Phone App”.

Choose A Platform

This displays the three easy steps to create a Windows Store app connected to your mobile service.

  1. Install Visual Studio Professional 2013, if you don’t have followed the first point and install on your local computer.
  2. Select the language for your App (I have selected C#).
  3. Click on “Download”.

    Click on Download

After clicking on to “Download”, it will download a project, click on to open it.

Download

Browse to the location where you saved the compressed project files, expand the files on your computer, and open the solution file in Visual Studio.

solution file in Visual Studio

Open the Visual Studio file.

Visual Studio file

Right click on to your service project and set it “Set as Startup Project”.

Save your project and press F5 to run your project.

Set as Startup Project

I’ve successfully run my application; follow the rectangle and click over it.

run my application

You can see, there is complete API Documentation of the Mobile Service.

You can perform any operation on the browser and after you can check Cloud where Mobile Service reside.

Mobile Service

Thanks for reading the article and stay tuned for upcoming articles where you will learn how to use APIs with your mobile project or web application.

Read more articles on Azure: