Getting your SQL Azure Account and creating your first database on the cloud. 

Cloud computing is here to stay and if you are a developer you cannot afford not to be updated with whats happening in that space. Windows Azure Platform is the cloud computing offering by Microsoft and though its still in a nascent stage, it is developing fast to soon realize the full potential of the cloud. This video is a good watch for folks who have just heard about azure but yet to realize its potential.

 With this post I hope to enumerate the steps to get started with SQL Azure and where to get more information from. Here is what you need -

  1. To start of you first need a SQL Azure invitation code, you can request one from http://go.microsoft.com/fwlink/?LinkID=149681&clcid=0×09
  2. Once you have the invite code, you need to redeem it from https://sql.azure.com using your LIVE account.
  3. After redeeming the code, a new project should appear in you SQL Azure account.
  4. Now you are ready to create your own database on the cloud! One that can be accessed from anywhere, all you need is internet connection!

Steps to create a Database -

  1. As you click on the project, the Server Administration page shows up, which has your admin information and the server name, which is the endpoint used access the DB.
  2. Master database is already create for you and contains the following tables for your reference - sql_logins, firewall_rules, bandwidth_usage, database_usage.
  3. To create you own database click on the "Create Database" button and select the size.
  4. Now click on the firewall setting tab to configure it without which you cannot access the database.
  5. Add rule MicrosoftServices with range 0.0.0.0 to 0.0.0.0, this is important for trivial things like testing connectivity from the databases tab itself.
  6. Add another rule with your IP address, it is possible that the IP address which show up on your machine using IPCONFIG may be different than the IP that shows up as "Your IP address" when you click on the Add Rule button. Use the one which shows up there.
  7. Give it 5 mins or so for the firewall rules to kick in and you are now ready to start connecting to the DB using SQLCMD.exe or SQL Management Studio 2008.

Connecting using SQLCMD

  1. Use switches -S for Server; -U for user id, -P for password, -d for Default database For ex - sqlcmd.exe -S<your fully qualified Server name> -U<your user name>@<server name> -dmaster

Connecting using SSMS 2008

  1. Bring up the SSMS and the login dialog appears, cancel that out and click on the New Query tool bar menu. Since SQL Azure supports connect only for querying.
  2. On the Connect to server dialog enter
  • Server type - Database Engine
  • Server name - full qualified server name eg - xxx.database.windows.net
  • Auth - SQL Server Auth
  • Login - username@xxx [note just the xxx part of xxx.database.windows.net]
  • On the Connection properties tab, enter the name of your database you want to connect to.

Enjoy!