Using Windows Azure SDK with SQL Server 2005/2008

I downloaded the Windows Azure SDK today and was going through the quick starts from MSDN , the quickstarts mention that you need SQL Server Express 2005/2008 to run the samples, but I only had SQL Server 2008 developer edition installed. I decided to give it a try anyways and immediately hit a snag when trying to build the samples because as expected it could not find the SQLExpress instance that it was assuming would be present on the localhost.

Here are the changes I had to make to get the samples and the SDK to work with SQLServer 2008 installed without an instance name on my laptop.

1. In Windows Azure SDK\v1.0\samples\MSBuild\Microsoft.Samples.ServiceHosting.targets , add the “/server” option to the UpdateSampleTablesDB target to make it look like

<Target Name=”UpdateSamplesTableDB” DependsOnTargets=”BuildSubProjects”>

    <Message Text=”$(DevTableGenCommand) /database:$(SamplesDBName) /server:localhost $(DevtableGenForceCreateFlag) @(DevTableGenAssemblies)”/>

    <Exec Condition=”‘$(SamplesDBName)’!=”” 

            Command=”$(DevTableGenCommand) /database:$(SamplesDBName) /server:localhost $(DevtableGenForceCreateFlag) @(DevTableGenAssemblies)” 

    WorkingDirectory=”$(MSBuildProjectDirectory)”/>

  </Target>

2. Change the datasource in the connection string used in  “Windows Azure SDK\v1.0\bin\DevelopmentStorage.exe.config” to localhost

<connectionStrings>

    <add name=”DevelopmentStorageDbConnectionString”

         connectionString=”Data Source=localhost;Initial Catalog=DevelopmentStorageDb;Integrated Security=True”

         providerName=”System.Data.SqlClient” />

  </connectionStrings>

3. Change the dbServer for the Table service in the developmentStorageConfig section to localhost in “Windows Azure SDK\v1.0\bin\DevelopmentStorage.exe.config”

    <services>

      <service name=”Blob”

               url=”http://127.0.0.1:10000/”/>

      <service name=”Queue”

               url=”http://127.0.0.1:10001/”/>

      <service name=”Table”

               url=”http://127.0.0.1:10002/”

        dbServer=”localhost“/>

 

    </services>

HTH

2 Comments

  1. You could also just create a sql alias using c:\windows\system32\cliconfg.exe – this way you won’t have to change any of these existing files and you won’t lose any functionality.

  2. This is not needed anymore, you should be able to change the db instance with DSInit.exe /sqlinstance:” It is included in SDK V1.1

1 Trackback

  1. ccBoy's WebLog : Windows Azure Resource (Pingback)