Thursday, December 1, 2011

Configuring SQL Server Instance for Windows Azure Storage Emulator

Let's say you have downloaded the Windows Azure SDK which installs several Add-on to Visual Studio 2010 and IIS, and includes some Windows Azure Solutions Templates. Now suppose you have created a Windows Azure Solution based on one of these templates, and are trying to debug the solution. The first time you try to debug the solution, you may come across the following message:
Windows Azure Tools: Failed to initialize Windows Azure storage emulator. Unable to start Development Storage. Failed to start Storage Emulator: the SQL Server instance ‘localhost\SQLExpress’ could not be found.   Please configure the SQL Server instance for Storage Emulator using the ‘DSInit’ utility in the Windows Azure SDK.
You will get this message if either of the items below applies to you:
  1. You don't have any SQL Server Installed on your workstation. 
  2. You don't have SQL Express installed and have the full version of SQL Installed
  3. You have an older version of SQL Express installed which Azure SDK does not support. 
If item 3 applies to you there is no choice but to install the latest SQL Express version.  But if you have the full version of SQL Installed as Default Instance, then you can do the following to fix the issue:
  1. Go to "Start > All Programs > Accessories", right click on "Command Prompt" and select "Run as Administrator".
  2. Navigate to "C:\Program Files\Windows Azure Emulator\emulator\devstore\" directory by entering "cd [Directory Path]" and hitting Enter. 
  3. Enter "DsInit /sqlInstance:." and hit Enter. 
Here is the Window you will see (or a slight variation from it which accomplishes the same thing):


That's it! You should now be able to rebuild your Azure Solution in Visual Studio 2010 and run it to debug it locally using the Azure Emulators.

Pete Soheil
DigiOz Multimedia, Inc.
www.digioz.com