An Avanade Blogging Community

Welcome to An Avanade Blogging Community Sign in | Join | Help
in Search

Aali - a developer's view

Playing with Windows Azure and SQL Azure

I have been playing around with Windows Azure and SQL Azure lately. Here are a few things that I have discovered along the way.

SQL Azure has a firewall, that by default blocks all external access. This includes also Windows Azure, so the firewall rules need to be relaxed to do anything useful with it. There is a setting in SQL Azure management site called "Allow Microsoft Services access to this server" which adds a range 0.0.0.0-0.0.0.0, but that was not enough to allow access from code running in Windows Azure roles. I needed to manually add my role IP addresses to the rule list (found out the address range by using logging, explained below). Don't know if my affinity group settings has an effect to this or not. Note that it takes a few minutes for the firewall rules to become effective.

Once you have loosened the firewall to allow traffic from your computer, you can use regular SQL Management Studio to query the SQL Azure databases. Note that you cannot connect to the database engine, only open a query window to a specific database. You cannot change active database either using use command inside query window so you need to pay attention to the options when opening a query connection!

Azure has built in logging features nowadays that fully support System.Diagnostics trace/error logging. However, if you want to look at the traces etc in production, you will need to configure Azure Storage, since table storage is the place where the diagnostics info can be transferred for viewing. There is an excellent talk in PDC09 that explains all aspects here: http://microsoftpdc.com/Sessions/SVC15. I had some trouble getting the logs transferred until I realized that my storage account was created last spring and probably was somehow an outdated version. It started working once I created a new storage account.

For viewing the logs I have used app called CloudStorageStudio from Cerebrata, but I am sure there are many alternatives (including building your own, of course).

Published Saturday, November 28, 2009 8:26 AM by aalialikoski
Filed Under:
Anonymous comments are disabled