Welcome!

Open Source Authors: Liz McMillan, Dana Gardner, Sandi Mappic, Bob Gourley, Michael Bushong

Blog Feed Post

Azure CLI Day 57 – storage account create

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.

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.