Welcome!

Think first. Code later.

Adam Grocholski

Subscribe to Adam Grocholski: eMailAlertsEmail Alerts
Get Adam Grocholski via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


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

Blog Feed Post

Azure CLI Day 21 – mobile create with existing database

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3200) I showed you how to provision a new Windows Azure mobile service and SQL database using the Windows Azure cross platform command line tools. In this post I’ll show you how to use the tools to provision a new Windows Azure mobile service that uses an existing SQL database.

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 create -h

Screen Shot 2013-09-17 at 9.53.36 AM

This is the same command we used in the last exercise to create a new mobile service and database. Since we’re creating a new mobile service that uses an existing database, we’ll need to use the following options:

  • -r, –sqlServer. The existing SQL server to use.
  • -d, –sqlDb. The existing SQL database to use.
  • -l, –location. The location to deploy the Windows Azure mobile service to.
  • servicename. The name of the Windows Azure mobile service.
  • sqlAdminUsername. The SQL admin username for the SQL server and database.
  • sqlAdminPassword. The SQL admin password for the SQL server and database.

Enter the following into your CLI, substituting where appropriate:

azure mobile create -r “[YOUR SQL SERVER NAME]” -d “[YOUR SQL DB NAME]” -l “[YOUR MOBILE SERVICE LOCATION]” “[YOUR MOBILE SERVICE NAME]” “[YOUR SQL ADMIN USERNAME]” “[YOUR SQL ADMIN PASSWORD]“

In my case I entered the following:

azure mobile create -r “nszecs2mp8″ -d “zumo101_db” -l “West US” “zumo102″ “adam” “[MY SQL ADMIN PASSWORD]“

Screen Shot 2013-09-17 at 9.59.37 AM

If you go to the MOBILE SERVICES portion of the Windows Azure management portal, you’ll see the new mobile service has been created.

Screen Shot 2013-09-17 at 10.03.13 AM

To verify the link to the existing database, go to the CONFIGURE portion of your Mobile Service’s dashboard.

Screen Shot 2013-09-17 at 10.04.09 AM

That’s it. In my next post I’ll show you how to get a list of all you mobile services.

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.