Archives For cloud computing

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3387) I showed you how to use the Windows Azure Cross Platform command line tools to update a scheduled job associated with a Windows Azure Mobile Services. In this post I’ll show you how to use the tools to delete a scheduled job.

Once again, just a reminder that I’m using the command line tools on a MacBook Air with OSX (Mavericks) 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 delete -h

Screen Shot 2013-10-22 at 6.41.19 PM

As you can see the azure mobile job delete command is the command to use to delete a job associated with a Windows Azure Mobile Service. You simply need to provide the name of the mobile service the job you want to delete is associated with as well as the name of the job itself.

To proceed with deleting a scheduled job, enter the following into your CLI, substituting where appropriate:

azure mobile job delete ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR JOB NAME]‘

I entered the following:

azure mobile job delete ‘zumo-00005′ ‘myFirstJob’

Screen Shot 2013-10-22 at 6.45.05 PM

Once the command completes, you can use the azure mobile job list command to verify the job has been deleted by entering the following, making the necessary substitutions:

azure mobile job list ‘[YOUR MOBILE SERVICE NAME]‘

I used the following:

azure mobile job list ‘zumo-00005′

Screen Shot 2013-10-22 at 6.47.14 PM

That’s it for working with Windows Azure Mobile Services scheduled jobs from the command line. In my next post I’ll show you how to use the cross platform command line tools to scale your Windows Azure 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.

bash-azure

In my previous two posts I showed you how to use the Windows Azure cross platform command line tools to:

In this post I’ll show you how to use these tools to update a scheduled job associated with a Windows Azure Mobile Service.

Once again, just a reminder that I’m using the command line tools on a MacBook Air with OSX (Mavericks) 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 update -h

Screen Shot 2013-10-22 at 6.16.20 PM

The azure mobile job update command is the command to use to update a scheduled job. As you can see, many of the parameters are similar to the parameters of the azure mobile job create command that I walked through in a previous post (http://thinkfirstcodelater.com/blog/?p=3342). In fact, the only difference is the -a or –status option. This options allows you to enable or disable a scheduled job. Since the job we initially created is currently disabled we’ll use this option to enable it.

Type the following into your CLI of choice, substituting where appropriate:

azure mobile job update -a enabled ‘[YOUR MOBILE SERVCE NAME]‘ ‘[YOUR JOB NAME]‘

In my case I entered the following:

azure mobile job update -a enabled ‘zumo-00005′ ‘myFirstJob’

Screen Shot 2013-10-22 at 6.26.04 PM

Once the command completes, you can verify the job has been enabled by using the azure mobile job list command by entering the following, substituting where necessary:

azure mobile job list ‘[YOUR MOBILE SERVICE NAME]‘

I entered the following:

azure mobile job list ‘zumo-00005′

Screen Shot 2013-10-22 at 6.29.26 PM

You can also verify by going to the Windows Azure Management Portal, and viewing the scheduled jobs for your Windows Azure Mobile Service.

Screen Shot 2013-10-22 at 6.30.15 PM

That’s it for now. In my next post I’ll wrap up working with scheduled jobs by showing you how to delete a job associated with a Windows Azure Mobile Service.

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

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3367) I showed you how to use the Windows Azure cross platform command line tools to download a script associated with a Windows Azure Mobile Service’s schedule job. In this post I’ll show you how to modify the script and upload to the 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.

Start by opening the downloaded script and changing the contents to the following:

function myFirstJob() {
    console.log("This is my first scheduled job!");
}

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

azure mobile script upload -h

Screen Shot 2013-10-14 at 8.22.11 PM

As you probably already guessed, the azure mobile script upload command is the command to use to upload a script to a Windows Azure Mobile Service. There are a few parameters/options you need to provide:

  1. servicename, the name of the mobile service
  2. scriptname, the name of the script
  3. -f, –file, the fuel to upload for the script

Now enter the following into your CLI, substituting where appropriate:

azure mobile script upload -f ‘[PATH TO YOUR MODIFIED SCRIPT FILE]‘ ‘[NAME OF YOUR MOBILE SERVICE]‘ ‘[NAME OF YOUR SCRIPT]‘

I used the following:

azure mobile script upload -f ‘/Users/adam/Code/zumo-00005/scheduler/myFirstJob.js’ ‘zumo-00005′ ‘scheduler/myFirstJob’

Screen Shot 2013-10-14 at 8.27.48 PM

You can verify the command by using the following:

azure mobile script download -c ‘[NAME OF YOUR MOBILE SERVICE]‘ ‘[NAME OF YOUR SCRIPT]‘

I used the following:

azure mobile script download -c ‘zumo-00005′ ‘scheduler/myFirstJob’

Screen Shot 2013-10-14 at 8.31.54 PM

That’s it. In my next post I’ll show you how to start a schedule job using the Windows Azure 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.

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3359) I showed you how to use the Windows Azure cross platform command line tools to list the scripts associated with a Windows Azure Mobile Service. In this post I’ll show you how to use that information to download a script associated with a 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 script download -h

Screen Shot 2013-10-14 at 7.55.51 PM

As you can see the azure mobile script download command can be used to download a script from a Windows Azure Mobile Service. In our case, we’ll download the script associated with a schedule job. There are a few parameters/options to provide to the command:

  • servicename, the name of the service that contains the script to be downloaded
  • scriptname, the name of the script to download
  • -f, –file, the local file to save the script to
  • -o, –override, override an existing file if one exists
  • -c, –console, write the script to the console instead of a file

We’ll start by writing the script to the console. Enter the following enter your CLI, substituting where appropriate:

azure mobile script download -c ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR SCRIPT NAME]‘

If you don’t know the name of the script associated with your mobile service’s scheduled job, please refer to my previous post (http://thinkfirstcodelater.com/blog/?p=3359). It should be in the format of scheduler/[job name]

In my case I entered the following:

azure mobile script download -c ‘zumo-00005′ ‘scheduler/myFirstJob’

Screen Shot 2013-10-14 at 8.03.00 PM

This simply writes the contents of the script to the console window. To download the script to a local file enter the following, once again substituting where appropriate:

azure mobile script download -f ‘[YOUR LOCAL FILE PATH]‘ -o ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR SCRIPT NAME]‘

I used the following:

azure mobile script download -f ‘/Users/adam/Code/zumo-00005/scheduler/myFirstJob.js’ -o ‘zumo-00005′ ‘scheduler/myFirstJob’

Screen Shot 2013-10-14 at 8.07.19 PM

Notice I gave the file a .js extension. This is because Windows Azure Mobile Services uses Node.js for server side scripts. You should now be able to navigate to the downloaded file on your local file system and open it using your favorite JavaScript editor (mine happens to be Sublime Text).

Screen Shot 2013-10-14 at 8.08.28 PM

That’s it for now. In my next post I’ll show you how to modify the script and upload the new version to your Windows Azure Mobile Service.

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

bash-azure

In my previous two posts I showed you how to use the Windows Azure cross platform command line tools to:

  1. Create a scheduled job for a Windows Azure Mobile Service (http://thinkfirstcodelater.com/blog/?p=3342)
  2. List the scheduled jobs associated with a Windows Azure Mobile Service (http://thinkfirstcodelater.com/blog/?p=3350)

In this post I’ll start looking at how to modify the script associated with a scheduled job.

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.

Before you can modify a script associated with a scheduled job you’ll probably want to download the default script that is created for the job. However, before you can download the script you need to know where it is. Open an instance of your command line (Terminal, Bash, Command Prompt, etc.) and type the following:

azure mobile script list -h

Screen Shot 2013-10-14 at 7.40.22 PM

The azure mobile script list command is the command to use to list all the scripts associated with a Windows Azure Mobile Service. The results will include scripts for scheduled jobs, custom API’s, as well as any table scripts you may have. At the time of this writing the results will not include any shared scripts. The only parameter you need to provide is the name of the Windows Azure Mobile Service.

Enter the following into your CLI, substituting where appropriate, to list all scripts associated with a Windows Azure Mobile Service:

azure mobile script list ‘[YOUR MOBILE SERVICE NAME]‘

I entered the following:

azure mobile script list ‘zumo-00005′

Screen Shot 2013-10-14 at 7.45.25 PM

In my case the results look the same as running the azure mobile job list command. However, if I had scripts for custom API’s or tables they would appear in the results. What is important to note here is the value in the Script name column of the results. We’ll use this value in the next post to look at different ways we can download the script.

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

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3342) I showed you how to use the Windows Azure cross platform command line tools to create a scheduled job for a Windows Azure Mobile Service. In this post I’ll show you how to list the scheduled jobs associated with a 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 job list -h

Screen Shot 2013-10-14 at 7.19.03 PM

The azure mobile job list command is used to list the jobs associated with a Windows Azure Mobile Service. For this command you simply need to provide the name of the mobile service that contains the list of jobs you want to see. Type the following into your CLI, substituting where appropriate:

azure mobile job list ‘[YOUR MOBILE SERVICE NAME]‘

I entered the following:

azure mobile job list ‘zumo-00005′

Screen Shot 2013-10-14 at 7.22.17 PM

Alternatively, you could add the –json option to see the results in json format:

Screen Shot 2013-10-14 at 7.22.52 PM

That’s it. Pretty simple. In the next post we’ll look at how to start working with the script associated with the 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.

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.

bash-azure

In my previous two posts I showed you how to use the Windows Azure cross platform command line tools to:

In this post I’ll show you how to use the command line tools to delete a table associated with a 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 delete -h

Screen Shot 2013-10-14 at 1.41.39 PM

As you can see the azure mobile table delete command is the command to use to delete a table associated with a Windows Azure Mobile Service. To use the command you need to provide the name (servicename) of your mobile service and the name (table name) of the table you want to delete. Optionally, you can also specify if you want to bypass the confirmation prompt by using the -q or –quiet option.

Before proceeding to delete a table, first get a list of tables associated with your mobile service by entering the following, substituting where appropriate:

azure mobile table list ‘[YOUR MOBILE SERVICE NAME]‘

I used the following command:

azure mobile table list ‘zumo-00005′

Screen Shot 2013-10-14 at 1.46.09 PM

As you can see, my mobile service has three tables. To delete a table from your mobile service, enter the following into your CLI:

azure mobile table delete -q ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR TABLE NAME]‘

Since I wanted to delete the GenreMovie table, I used the following:

azure mobile table delete -q ‘zumo-00005′ ‘GenreMovie’

Screen Shot 2013-10-14 at 1.48.45 PM

Once the command completes you can verify the table was deleted by once again using the following, substituting where appropriate:

azure mobile table list ‘[YOUR MOBILE SERVICE NAME]‘

Once again I used the following:

azure mobile table list ‘zumo-00005′

Screen Shot 2013-10-14 at 1.50.29 PM

That’s it for using the Windows Azure Cross Platform Command Line tools to work with tables and data associated with a Windows Azure Mobile Service. In my next post I’ll start looking at how to use the tools to work with schedule jobs associated with a Windows Azure Mobile Service.

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

bash-azure

In my last post (http://thinkfirstcodelater.com/blog/?p=3310) I showed you how to read data from a table associated with your Windows Azure Mobile Service using the cross platform command line tools. In this post I’ll show you how to use those tools to truncate, or delete all of the data, from a table associated with 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 data truncate -h

Screen Shot 2013-10-12 at 9.35.19 AM

As you can see from the above screenshot the azure mobile data truncate command is the command to use when you want to delete all of the data from a table. For this particular command there are three parameters/options to know about:

  • servicename, the name of the service containing the table you want to truncate
  • tablename, the name of the table you want to truncate
  • -q, –quiet, whether or not you want to prompt for confirmation prior to truncating the table

Before we truncate a table, let’s use the azure mobile table list command to get a list of all the tables associated with our mobile service. Enter the following int your CLI, substituting where appropriate

azure mobile table list ‘[YOUR MOBILE SERVICE NAME]‘

I entered the following:

azure mobile table list ‘zumo-00005′

Screen Shot 2013-10-12 at 10.18.07 AM

As you can see, my particular mobile service has three tables. For this exercise, I’ll truncate the GenreMovie table. Enter the following into your CLI, once again substituting where appropriate:

azure mobile data truncate -q ‘[YOUR MOBILE SERVICE NAME]‘ ‘[YOUR TABLE NAME]‘

I entered the following:

azure mobile data truncate -q ‘zumo-00005′ ‘GenreMovie’

Screen Shot 2013-10-12 at 10.21.50 AM

Notice I used the -q option to suppress confirmation of the operation. You can verify the success of the truncation operation by entering the following int your CLI, substituting where appropriate

azure mobile table list ‘[YOUR MOBILE SERVICE NAME]‘

I entered the following:

azure mobile table list ‘zumo-00005′

Screen Shot 2013-10-12 at 10.23.14 AM

Notice the GenreMovie table now contains 0 rows.

That’s it for now. In the next post I’ll show you how to delete a table from your Windows Azure Mobile Service.

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

bash-azure

In my last post (http://thinkfirstcodelater.com/blog/?p=3297) I mentioned that I would use my next post, that’s this one, to show you how to delete a table associated with a Windows Azure Mobile Service. However, I then realized that there are two things I want to show you how to do prior to deleting a table. The first of which is how to read data from a table using the Windows Azure cross platform command line tools. I’ll use this post to show you how to do exactly that.

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 data read -h

Screen Shot 2013-10-11 at 9.09.26 AM

The mobile data read command is the command to use to view data in a table. As you can see there are several options and parameters you can use to define the data that gets displayed.

Options:

  • -k, –skip, skips the first specified number of rows
  • -t, –top, returns the first specified number of rows
  • -l, –list, displays the results in list format

Parameters:

  • servicename, the name of the mobile service containing the table you want to read data from (required)
  • table, the name of the table you want to read data from (required)
  • query, the query you want to execute (not required)
  • Let’s start using the command to simply read data from a table. Enter the following into your CLI, substituting where appropriate:

    azure mobile data read “[YOUR MOBILE SERVICE NAME]” “[YOUR TABLE NAME]“

    In my case I entered the following:

    azure mobile data read “zumo-00005″ “Movie”

    Screen Shot 2013-10-11 at 9.18.44 AM

    As you can see from the above screenshot, the data is returned in a nice table. If you’d prefer to see the data in a list format, enter the following:

    azure mobile data read -l “[YOUR MOBILE SERVICE NAME]” “[YOUR TABLE NAME]“

    I entered the following:

    azure mobile data read -l ‘zumo-00005′ ‘Movie’

    Screen Shot 2013-10-11 at 9.21.43 AM

    You can also have the data formatted as json using the standard –json option by using the following:

    azure mobile data read –json “[YOUR MOBILE SERVICE NAME]” “[YOUR TABLE NAME]“

    I entered the following:

    azure mobile data read –json ‘zumo-00005′ ‘Movie’

    Screen Shot 2013-10-11 at 9.22.35 AM

    If you want to just return the first record you can use the -t or –top option like this:

    azure mobile data read –top 1 “[YOUR MOBILE SERVICE NAME]” “[YOUR TABLE NAME]“

    I used:

    azure mobile data read –top 1 ‘zumo-00005′ ‘Movie’

    Screen Shot 2013-10-11 at 9.43.16 AM

    If you want to return the last record you could use the -s or –skip option like this:

    azure mobile data read –skip 4 –top 1 “[YOUR MOBILE SERVICE NAME]” “[YOUR TABLE NAME]“

    I used:

    azure mobile data read –skip 4 –top 1 ‘zumo-00005′ ‘Movie’

    Screen Shot 2013-10-11 at 9.45.17 AM

    That’s it for now. In my next post I’ll show you how to truncate the data in a table.

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