In my most recent set of posts in this series I showed you how to use the Windows Azure cross platform command line tools to manage a Windows Azure Mobile Service. I’m now going to change focus and look at how you can use the cross platform command line tools to manage a SQL database. I’ll start by showing you how to create a SQL database 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 create -h
The azure sql server create command is the command to use to create a SQL database server. There are several parameters/options to specify:
- —administratorLogin. The administrator’s login for the SQL database server.
- —administratorPassword. The administrator’s password for the SQL database server.
- —location. The location where the SQL database server should be created.
- —defaultFirewallRule. Adds a rule to the SQL database server allowing access from Windows Azure.
To create a server in West US, enter the following into your CLI, substituting where appropriate:
azure sql server create —defaultFirewallRule ‘[YOUR ADMIN NAME]‘ ‘[YOUR ADMIN PASSWORD]‘ ‘West US’
I used the following:
azure sql server create —defaultFirewallRule ‘adam’ ‘MY PASSWORD’ ‘West US’
Once the command completes and the SQL database server is created, the name of the server will be in the output of the CLI. You can go to the Windows Azure Management Portal to verify the server has been created.
That’s it for now. In my next post I’ll show you how to use the cross platform command line tools to list your SQL servers.
Did you know you can try Windows Azure for free for 30 days? Just go to http://aka.ms/thecloud and sign up.