Archives For azure cli

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3606) I showed you how to use the Windows Azure cross platform command line tools to list storage accounts associated with a Windows Azure subscription. In this post I’ll show you how to use these tools to view the details for a specific storage account.

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 storage account show -h

Screen Shot 2013-12-03 at 8.48.35 AM

The azure storage account show command is the command to use to show the details of a specific storage account associated with a Windows Azure subscription. the only parameter you need to provide is the name name of the storage account. To view the details of one of your storage accounts, enter the following into you CLI, substituting where appropriate:

azure storage account show ‘[YOUR STORAGE ACCOUNT NAME]‘

I entered the following:

azure storage account show ‘adgrocstorage75′

Screen Shot 2013-12-03 at 8.51.38 AM

The details displayed for the storage account include the following properties:

  • endpoints
  • location
  • label
  • status
  • geoReplicationEnabled
  • geoPrimaryRegion

That’s it for now. In my next post I’ll show you how to update the properties of a storage account 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 last post (http://thinkfirstcodelater.com/blog/?p=3590) I showed you how to use the Windows Azure cross platform command line tools to create a Windows Azure storage account. In this post I’ll show you how to use the tools to list the Windows Azure storage accounts associated with your Windows Azure subscription.

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 storage account list -h

Screen Shot 2013-12-02 at 11.02.39 AM

As you can see, the azure storage account list command simply lists the Windows Azure storage accounts associated with your Windows Azure subscription. To list your storage accounts, type the following into your CLI:

azure storage account list

Screen Shot 2013-12-02 at 11.05.25 AM

The command results in three column table that provides you with the name, label (if specified), and location for each storage account in your subscription. If you want more details about each storage account in your subscription, you can use the —json parameter. Type the following into your CLI:

azure storage account list —json

Screen Shot 2013-12-02 at 11.08.59 AM

As you might expect, the results of this command are returned in json format and include the following properties:

  • endpoints
  • status
  • geoReplicationEnabled
  • geoPrimaryRegion
  • geoSecondaryRegion

That’s it for this post. In my next post I’ll show you how to use the Windows Azure cross platform command line tools to view the details of a specific storage account.

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 12 posts in this series I showed you how to use the Windows Azure cross platform command line tools to manage SQL servers and databases running in Windows Azure. In this post I’ll start taking a look at the commands available in the CLI tools to you to manage Windows Azure storage object. I’ll start with showing how to create a storage account.

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

Screen Shot 2013-11-26 at 3.37.11 PM

This shows all the commands you can use to manage storage objects. Before you can do anything with storage objects you first need to have a storage account, so let’s look at the commands specific to storage accounts. Type the following into your CLI:

azure storage account -h

Screen Shot 2013-11-26 at 3.39.20 PM

This shows you all the storage account specific commands available to you in the cross platform command line tools. Since a storage account is needed before you can do anything else, let’s take a look at the create command. Type the following into your CLI:

azure storage account create -h

Screen Shot 2013-11-26 at 3.41.40 PM

As you can probably guess by the name, the azure storage account create command will create a new Windows Azure storage account for your subscription. The only parameter you need to specify is the name of the storage account. There are a few options you can use as well when creating a Windows Azure storage account:

  • -e, –label – the label of the storage account
  • -d, –description – the description of the storage account
  • -l, –location – the location of the storage account
  • -a, –affinity-group – the affinity group* the storage account is associated with
  • –geoReplication – enable geo-replication** for the storage account
  • –disable-geoReplcation – disable geo-replication** for the storage account

*Affinity groups allow you to group your Windows Azure services to optimize performance. All services within an affinity group will be located in the same data center.

**When geo-replication is turned on for a storage account, the stored content is replicated to a secondary location to enable failover to that location in case of a major disaster in the primary location. The secondary location is in the same region, but is hundreds of miles from the primary location. Geo-replication is turned on by default.

To create a new storage account in the West US region, enter the following into your CLI, substituting where appropriate:

azure storage account create -l ‘West US’ ‘[YOUR STORAGE ACCOUNT NAME]‘

I entered the following:

azure storage account create -l ‘West US’ ‘adgrocstorage75′

Screen Shot 2013-11-26 at 3.56.55 PM

Once the command completes, you can log in to the Windows Azure Management Portal and verify that the storage account has been created.

Screen Shot 2013-11-26 at 3.58.09 PM

That’s it for now. In my next post I’ll show you how to use the Windows Azure cross platform command line tools to list the storage accounts associated with your subscription.

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=3570) I showed you how to use the Windows Azure cross platform command line tools to delete a SQL database. In this post I’ll show you how to use the tools to delete a SQL server.

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 sql server delete -h

Screen Shot 2013-11-26 at 12.18.19 PM

The azure sql server delete command is the command to use to delete a SQL server. The only parameter you need to specify is serverName, which, as you can probably guess is simply the name of the SQL server you want to delete. You can specify the -q, —quiet option if you want to suppress the confirmation prompt.

To delete a SQL server, enter the following into your CLI, substituting where appropriate:

azure sql server delete -q ‘[YOUR SQL SERVER NAME]‘

I entered the following:

azure sql server delete -q ‘woa74eflzv’

Screen Shot 2013-11-26 at 12.21.47 PM

Once the command completes, you can use the azure sql server list command (http://thinkfirstcodelater.com/blog/?p=3463) to verify the SQL server has been deleted.

Screen Shot 2013-11-26 at 12.23.12 PM

That’s all there is to it. In my next post I’m going to start looking at how you can use the Windows Azure cross platform command line tools to manage your Windows Azure storage accounts.

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 three previous posts I showed you how to use the Windows Azure cross platform tools to do the following:

In this post I’ll show you how to use the tools to delete a SQL database.

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 sql db delete -h

Screen Shot 2013-11-26 at 9.58.05 AM

The azure sql db delete command is the command to use to delete a specific SQL database. At the time of this writing there is an error in the Usage portion of the documentation. The administratorLogin parameter is missing. The documentation should actually read:

Usage: sql db delete [options] <serverName> <databaseName> <administratorLogin> <administratorPassword>

There are several parameters you need to provide in order to delete a SQL database:

  • serverName – the name of the SQL server that contains the database to be deleted
  • databaseName – the name of the SQL database to be deleted
  • administratorLogin – the administrator login for the SQL server
  • administratorPassword – the administrator password for the SQL server

Additionally, you can specify the -q, —quiet to suppress the confirmation prompt.

To delete a SQL database, enter the following int your CLI, substituting where appropriate:

azure sql db delete -q ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR SQL DATABASE NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db delete -q ‘woa74eflzv’ ‘my_second_db’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 10.16.37 AM

Once the command completes you can use the azure sql db list command (http://thinkfirstcodelater.com/blog/?p=3553) to verify the database has been deleted.

Screen Shot 2013-11-26 at 10.18.36 AM

That’s it for now. In my next post I’ll show you how to use the Windows Azure cross platform command line tools to delete a SQL server.

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

Azure CLI Index

December 6, 2013

NewImage

This is just a simple post indexing all of my posts related to the Windows Azure cross platform (xplat) command line tools. I’ll plan on updating this entry on a weekly basis. I’ll also update this post’s published date so that it should pop to the top of your feed each Friday.

New this week

Getting Started

Windows Azure Web Sites

Windows Azure Mobile Services

SQL Database

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=3553) I showed you how to use the Windows Azure cross platform command line tools to list the SQL databases for a specific SQL server. In this post I’ll show you how to use the tools to view the details for a specific SQL database.

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 sql db show -h

Screen Shot 2013-11-26 at 8.43.48 AM

The azure sql db show commands shows the details of a specific SQL database. To use the command you must provide the following parameter values:

  • serverName – the name of the SQL server that contains the SQL database
  • databaseName – the name of the SQL database you want the details for
  • administratorLogin – the administrator login of the SQL server
  • administratorPassword – the administrator password of the SQL server

To view the details of a specific SQL database, enter the following into your CLI, substituting where appropriate:

azure sql db show ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR SQL DATABASE NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db show ‘woa74eflzv’ ‘my_first_db’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 8.49.54 AM

That’s it, pretty straightforward. In my next post I’ll show you how to delete a SQL database 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=3540) I showed you how to create a SQL database using the Windows Azure cross platform command line tools. In this post I’ll show you how to use these tools to list your SQL database.

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 sql db list -h

Screen Shot 2013-11-26 at 8.21.41 AM

The azure sql db list commands lists SQL databases on a specific SQL server. In order to use the command you must provide the following parameters:

  • serverName – the name of the SQL server you want to list databases for
  • administratorLogin – the administrator login of the SQL server
  • administratorPassword – the administrator password of the SQL server

To list databases on a particular server, enter the following into your CLI, substituting where appropriate:

azure sql db list ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db list ‘woa74eflzv’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 8.28.44 AM

This will give you a basic list of the databases associated with a specific SQL server. If you would like to see detailed information about each database use the —json option by entering the following into your CLI:

azure sql db list —json ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db list —json ‘woa74eflzv’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 8.32.55 AM

That’s it for now. In my next post I’ll show you how to view the details of a specific SQL database 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=3531) I showed you how to use the Windows Azure cross platform command line tools to delete a firewall rule from a SQL server. In this post I’ll show you how to use the tools to create a SQL database.

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

Screen Shot 2013-11-09 at 3.50.36 PM

The azure sql db create command creates a database on a SQL server. At a minimum there are four parameters you need to provide:

  • serverName – the name of the SQL server where the new database will be created.
  • databaseName – the name of the new database.
  • administratorLogin – the administrator login for the SQL server.
  • administratorPassword – the administrator’s password for the SQL server.

There are also some optional parameters you can use:

  • collationName – the database collation to use.
  • edition – the database edition to use.
  • maxSizeInGB – the maximum size of the database in GB.
  • location – the location of the database.

For this post, we’ll just stick with the required parameters.

Note: in order to use the Windows Azure command line tools to create a SQL database, you must have a firewall rule created on your SQL server that allows your computer’s IP address to connect to the SQL server. To learn how to do this please see my post on the topic (http://thinkfirstcodelater.com/blog/?p=3479).

To create a database, enter the following into your CLI, substituting where appropriate:

azure sql db create ‘[YOUR SQL SERVER NAME]‘ ‘my_new_db’ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db create ‘thbmcjr7xb’ ‘my_new_db’ ‘MY ADMIN LOGIN’ ‘MY ADMIN PASSWORD’

Screen Shot 2013-11-09 at 4.06.45 PM

Once the command completes, you can confirm the database was created by going to the Windows Azure Management Portal and navigating to the SQL DATABASES section.

Screen Shot 2013-11-09 at 4.11.53 PM

That’s all for now. In my next post I’ll show you how to list the databases on a specific SQL server.

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 three previous 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 Windows Azure cross platform command line tools to delete a SQL database server firewall rule.

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 sql firewallrule delete -h

Screen Shot 2013-11-09 at 3.16.19 PM

The azure sql firewallrule delete command is the command to use to delete a a firewall rule from a SQL database server. The following two parameters are required:

  • serverName – the name of the SQL server where the firewall rule resides.
  • ruleName – the name of the firewall rule to delete

Optionally, you can also specify the -q, —quiet option to suppress the confirmation prompt during the deletion process.

To delete a firewall rule, enter the following into your CLI, substituting where appropriate:

azure sql firewall rule delete -q ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR FIREWALL RULE NAME]‘

I entered the following:

azure sql firewallrule delete -q ‘thbmcjr7xb’ ‘the internet’

Screen Shot 2013-11-09 at 3.26.11 PM

Once the command completes, you can verify the firewall rule has been deleted by using the azure sql firewallrule list command. Enter the following int your CLI, substituting where appropriate:

azure sql firewallrule list ‘[YOUR SQL SERVER NAME]‘

I used the following:

azure sql firewallrule list ‘thbmcjr7xb’

Screen Shot 2013-11-09 at 3.32.42 PM

That’s it for now. In my next post I’ll start focusing on how to managing SQL databases 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.