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 34 – mobile job create

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3329) I showed you how to delete a table associated with a Windows Azure Mobile Service. In this post I’m going to shift away from working with Windows Azure Mobile Service tables and data and start focusing on schedule jobs. Scheduled jobs allow you define server scripts that are executed either on a schedule you define or on demand.

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

Screen Shot 2013-10-14 at 6.47.37 PM

As you can see the azure mobile job create command is the command to use when you want to create a job. There are several parameters/options you can use

  • servicename, the name of the service you want to create the job for
  • jobname, the name of the job
  • -i, –interval, the job interval
  • -u, –intervalUnit, the unit associated with the interval (can be minute, hour, day, month, or none for on-demand jobs)
  • -t, –startTime, time of the first run of the scheduled job, the default is now

For this exercise we’ll create a job that runs every fifteen minutes. Type the following into your CLI, substituting where appropriate:

azure mobile job create -i 15 -u ‘day’ ‘[YOUR MOBILE SERVICE NAME]‘ ‘myFirstJob’

I used the following:

azure mobile job create -i 15 -u ‘day’ ‘zumo-00005′ ‘myFirstJob’

Screen Shot 2013-10-14 at 6.57.07 PM

You can verify the command was successful by going to the Windows Azure Management Portal and navigating to the Scheduler portion of your Windows Azure Mobile Service.

Screen Shot 2013-10-14 at 6.58.28 PM

In upcoming posts I’ll show you how to do the following:

  1. List your scheduled jobs
  2. Modify the script associated with a scheduled job
  3. Update a scheduled job
  4. Delete a scheduled job

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.