App Service is the newest offering from Microsoft Azure. It encompasses 4 main application types. Namely – Web Apps, Mobile Apps, API Apps and Logic Apps. With one container you can create any or all of the services. Prior to App Service we had Azure WebSites and Azure Mobile Services. WebSites & Mobile Services would create 2 completely different containers.

About Azure App Service:

Who can explain this better that the guru himself. Well, I am talking about Scott Guthrie or Gu as we call him. Here is his blog post explaining what exactly is Azure App Service: http://weblogs.asp.net/scottgu/announcing-the-new-azure-app-service

Azure App Service

Azure App Service

About Mobile Apps:

Mobile Apps are nothing but what we had as Mobile Services. Mobile Apps provide you the option of creating a Mobile backend for your Mobile Apps. Apart from the features from Mobile Services, Mobile Apps also provide the following benefits:

  • Built in Auto Scale support
  • CI/CD support with VSO/GitHub/BitBucket
  • Staged Deployments
  • WebJob support
  • Traffic Manager Support

About Easy Tables:

By now, you may be wondering what this “Easy Table” is. Let me explain that for you. Easy Table is also known as “No-Code Table or API”. We say so because you literally write zero code to create a backend for your mobile app using Azure App Service Mobile Apps. Typically with any backend you need a table and table will contain columns. When we had Mobile Services – it supported dual development modes i.e. I could create the tables using no-code way or using C# code. When App Service Mobile App was first introduced, it only supported the code way. You had to create a File > New Project using Visual Studio and deploy it. Microsoft released the support of Easy Tables within Mobile Apps in an update which was rolled out during Nov 2015. In this blog post we will walkthrough how to create an Easy Table in your Mobile App backend.

These Easy Tables are mobile friendly (dah … it is a mobile app after all), ODATA friendly and are backed by SQL Azure. Easy Tables support is still in preview and is limited to apps which are created from within the portal.

Create a new Azure Mobile App Backend:

Follow the below steps to create a new Mobile App Backend.

  1. Log into the new Azure Portal – http://portal.azure.com
  2. Click the +New button which is found on top left of the window. Select Web + Mobile > Mobile App.
    Create New Mobile Appq

    Create New Mobile App

  3. In the Mobile App create window provide a name for your Mobile App backend. Subscription will be auto selected. Leave that as is.
    Mobile App Creation Blade

    Mobile App Creation Blade

  4. Next, you need to select a Resource Group for your app. You can select an existing resource group of yours or create a new resource group. In order to create a new resource group, click on New button which is available in Resource Group section. I will create a new resource group with the name “EasyTableMobAppRG” for this excercise.
  5. Next you need to select App Service Plan/Location. You can use the default app service plan or create a new plan. Click Create when done.

This will now create a Mobil App Backend. Provisioning of the Mobile App backend can take several minutes. You can monitor the progress using the notification area. Once the deployment succeeds, the settings blade of the newly create Mobile App will open automatically.

Mobile App Details Blade

Mobile App Details Blade

 

Create a Data Connection to your Mobile App Backend:

Before we can do anything with our Mobile App backend – it needs a data store. Follow the steps below to create a data store.

  1. In the Settings blade, click on Data This will launch Data Connections blade. Since we don’t have any data connections defined yet, Add data connection blade will be opened automatically.
    Mobile App > Data Connections Blade

    Mobile App > Data Connections Blade

  2. In Add data connection blade, click SQL Database > Create a new database, type the database Name, choose the pricing tier and then click Server. In the New Server blade, type a unique name in the Server name field, provide a secure Server admin login & password. Make sure that you check the checkbox “Allow azure services to access server”. Then click Ok twice. This create a new database and a new server.
    Add Data Connection Blade

    Add Data Connection Blade

  3. Next, back in the Add data connection blade, click Connection string. Type the login & password for your database. Then click OK

Creation of database & server takes some time. You can monitor the progress using the notification area.

Enabling Easy Tables:

Now that we have a Mobile App backend and database created, it’s time to enable Easy Tables. Follow the steps below.

  1. In the Settings blade of your mobile app, click on Easy Tables In the Easy Tables blade, you will see a notification which says “Need to configure Easy Tables/Easy APIs – Click here to continue”. Click on that notification.
    Easy Tables Blade

    Easy Tables Blade

  2. In the Easy Tables blade, it will detect that we already have a data connection. In order to initialize Easy Tables, we need to check the checkbox provided in section 2 and click on the button Initialize App.
    Easy Table Initialization

    Easy Table Initialization

It will take some time for the Easy Tables feature to be enabled. You can monitor the progress using the Notification area. Once the Easy Tables feature has been enabled, you can then add new table to your mobile app.

Adding new Table to your Mobile App:

Follow the steps below to create new Tables in your Mobile App backend.

  1. From Settings blade, select Easy Tables node.
  2. In Easy Tables blade, select +Add button which is found at the top of the blade.
    Easy Tables > Add New Table

    Easy Tables > Add New Table

  3. In Add a Table blade, enter a Name for your table. Then set permission for Insert, Update, Delete, Read and Undelete operation. You can also decide if you need Soft delete by clicking the checkbox Enable soft delete. Click OK to create the table.
    New Table Creation Blade

    New Table Creation Blade

  4. Once the table has been created, Click on the table name in Easy Tables blade. This will open up a blade where you can manage the Table. You will be able to Change permission, Edit the underlying server side script, Manage schema, Delete table, Clear table, Delete rows and view the Streaming logs.
    Easy Table Listing Blade

    Easy Table Listing Blade

  5. By default only Audit columns will be created in the table. We can now add columns that we want in our table. Click on Manage schema to add new columns.
  6. In Schema blade, Existing columns will be displayed in a grid. To add new column, click on +Add button on the top of the blade. In Add a column blade, provide the Column name and select the Data type. Click OK to create the column.
    Add a Column blade

    Add a Column blade

You can add as many column as you want depending on your project needs. With this now we have created our Mobile App backend which contains a Table and we have not written any code till this point. This is Easy Table for you.

 

You can now connect to your Mobile App backend from any apps using any of the available Client SDK. At the moment for Mobile Apps we have .NET/iOS/Android SDK available for download. Mobile App team is working towards bringing the JavaScript client SDK soon. Once the JS SDK is out you can connect to your Mobile App backend even from a Hybrid App. In the meantime if you want to connect to your Mobile App backend tables from a Hybrid Mobile App, you can do so by connecting to the REST endpoints that are exposed by the tables and make HTTP calls accordingly.

 

That’s it for this blog post. Hope you now have the information to get started with Azure App Service Mobile App & Easy Tables.

 

Till next time – Happy Coding. Code with Passion, Decode with Patience.

 

  • Reto S

    Interesting article, thank you. I am having troubles though to understand the last part “by connecting to the REST endpoints that are exposed by the tables”. How can I connect to these endpoints?

    • hi.
      thanks for reading my article. At the moment – if you have create your mobile app backend using the Easy Tables way – there is no client SDK available for JavaScript. But they have Windows/Android/iOS Client SDK to talk to Easy Tables in your Mobile App. So if you have Mobile App which is built using JavaScript and you want to read data from your easy tables on azure – you will need to go through RAW REST API supported by the mobile app backend. it is usually http:///tables/ … the JS SDK is undergoing changes to meet the new App Service Mobile App infrastructure. we don’t know the ETA to that JS client SDK. hope this answers your question.

      • Osbornian

        I have been trying to use the REST APIs to no avail. I have a node backend, and I can use the Easy APIs behind http:///api/ but I can’t get the same to work for the tables.

        • hi – using tables is similar … you will have to hit the table endpoint like this: http://yoursite/tables/tablename
          ofcourse – you will need to make sure you pass the right headers – for e.g. they expect a header ZUMO-API-VERSION:2.0.0. if you have authentication enabled – you will need to pass the tokens …

  • Bigtony

    Very interesting. Is there any guidance on how to secure these rest endpoints using API keys or other methods?

  • Jason H

    Thank you for the excellent (and only real helpful) article on Easy Tables!
    Where can I find more information on how to configure these tables? I’m completely new to Azure and fairly new to SQL. I’d like to optimize a table so that I can return the last N rows of the table (by updatedAt) in an efficient query. In fact, that’s the only query that will ever be issues against this table. So something like this: https://azure.microsoft.com/en-us/documentation/articles/storage-table-design-guide/#log-tail-pattern. I see that I can open up my table in “Monaco” and change features such as ‘softDelete’ and ‘autoIncrement’, but what about setting up RowKeys?

  • Hi Lohith. Thank you for the post. At the end you mention access via REST. I am using PHP and I’m capable of doing POST and GET but PUT is not working. Any ideas on how a simple PUT via PHP would look like ? Thanks. Konrad

  • EMU

    This might be a silly queston but how do you get data into that table?
    I mean, I’d like to ust this to spread data to mobile apps but that data gets entered not by the mobile apps themselves but by a website hosted in azure. How would that work? Can an asp.net web api 2 service access this “easy table” in order to insert, modify and delete entries?

  • Mochamad Iqbal Dwi Cahyo

    “In the meantime if you want to connect to your Mobile App backend tables from a Hybrid Mobile App, you can do so by connecting to the REST endpoints that are exposed by the tables and make HTTP calls accordingly.”

    Does this mean, we’ve to built our own custom API, to connect the custom Easy Tables?