Saturday, November 15, 2008

Azure Tip: How to Get Cloud Storage Working Locally if You're Not Running SQL Server Express

If you're having trouble getting cloud storage to run locally on your box, this tip from Neudesic rock star Chris Rolon may help. It's especially likely this is your problem if the version of SQL Server you run isn't SQL Server Express.

If you're not running SQL Server Express, you'll need to change two values in the DevelopmentStorage.exe.config file which resides in C:\Program Files\Windows Azure SDK\v1.0\bin to have the correct SQL Server instance name (shown in red below).
  • The first is the DevelopmentStorageDbConnectionString value in the connectionStrings section.
  • The second is the dbServer value in the developmentStorageConfig section's third Service entry (the one named Table).

<connectionStrings>
<add name="DevelopmentStorageDbConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=DevelopmentStorageDb;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>

<appSettings>
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>

<developmentStorageConfig>
<services>
<service name="Blob" url="http://127.0.0.1:10000/"/&gt;
<service name="Queue" url="http://127.0.0.1:10001/"/&gt;
<service name="Table" url="http://127.0.0.1:10002/" dbServer="localhost\SQLExpress"/>
</services>

Note that the first entry uses "." to indicate local machine while the second uses "localhost."

2 comments:

Andreas Öhlund said...

And if you want to build the samples using the .cmd-files included in the sample.zip you have to modify the dbservername in Microsoft.CloudService.targets located in C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0

Great azure posts btw!

Andreas Öhlund said...

Forgot one thing, you have to add /server:localhost in the Microsoft.Samples.ServiceHosting.targets file that is located in the ....samples\msbuild\ directory