For Those Building New Apps in the Cloud

Azure Cloud on Ulitzer

Subscribe to Azure Cloud on Ulitzer: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Azure Cloud on Ulitzer: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Azure Authors: Yeshim Deniz, Elizabeth White, Pat Romanski, Zakia Bouachraoui, Nick Basinger

Related Topics: Ubuntu Linux Journal, SEO Journal, Azure Cloud on Ulitzer

Blog Feed Post

Azure CLI Day 30 – mobile table update

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3290) I showed you how to view details for a specific table in your Windows Azure Mobile Service using the Windows Azure cross platform command line tools. In this post I’ll show you how to modify an existing table in your Windows Azure Mobile Service.

Once again, just a reminder that I’m using the command line tools on a MacBook Air with OSX (Mountain Lion) installed, and I’m using Google Chrome as my default browser. However, the experience should be identical on Windows and Linux as well.

Open an instance of your command line (Terminal, Bash, Command Prompt, etc.) and type the following:

azure mobile table update -h

Screen Shot 2013-10-04 at 9.56.46 AM

The mobile table update command is the command to use if you want to modify a table. You need to specify two parameters in order to use the command:

  1. The name of your Windows Azure Mobile Service
  2. The name of the table you want to update

You can use the following options to perform various update operations on a table:

  • -p, –permissions. Update the permissions associated with the table’s operations (insert, read, update, delete).
  • –deleteColumn. Delete columns from the table.
  • –addIndex. Add indexes to the table.
  • –deleteIndex. Delete indexes from the table.

For this post, we’ll simply add an index to a table. Enter the following command into your CLI to view the details for a specific table, substituting where appropriate:

mobile table show ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR TABLE NAME]‘

In my case I entered the following:

mobile table show ‘zumo-00005′ ‘Movie’

Screen Shot 2013-10-04 at 10.04.48 AM

Currently my Movie table has a single index on the id column. To add an index to a column enter the following into your CLI, once again substituting where appropriate:

azure mobile table update –addIndex ‘[YOUR COLUMN NAME]‘ ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR TABLE NAME]‘

In my case I entered the following:

azure mobile table update –addIndex ‘title’ ‘zumo-00005′ ‘Movie’

Screen Shot 2013-10-04 at 10.08.02 AM

Once the operation completes successfully, run the mobile show command again using the following:

mobile table show ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR TABLE NAME]‘

In my case I entered the following:

mobile table show ‘zumo-00005′ ‘Movie’

Screen Shot 2013-10-04 at 10.09.19 AM

We now see the second index has been added to the table. This can also be verified by going to the Windows Azure Management Portal, navigating to your Mobile Service, going to the data tab, and clicking on the table you just updated.

Screen Shot 2013-10-04 at 10.10.47 AM

That’s it for now. In my next post I’ll show you how to delete a table from your Windows Azure Mobile Service using the cross platform command line tools.

Did you know you can try Windows Azure for free for 30 days? Just go to http://aka.ms/thecloud and sign up.

Read the original blog entry...

More Stories By Adam Grocholski

Hey there! My name is Adam Grocholski, and I'm a Technical Evangelist at Microsoft where I spend time focusing on Windows, Windows Phone, and Windows Azure. I live in the frozen tundra of Minnesota and run thinkfirstcodelater.com. You can also follow me on twitter at @codel8r.