Freigeben über


Azure Development Storage Database Deleted

Story goes something like this (btw, autonumber in Live Writer won’t let me start at 0):

  1. Install the tools and sdk to do some Azure development.
  2. I decide to install a non-Express version of SQL Server 2008.
  3. I decide I no longer need the SQL Express installation and uninstall it.
  4. time goes by…..
  5. One day I decide, after an Azure break, that I need to try something out and fire up studio.
  6. After creating a new web role and making some changes on a page I attempt to debug.
  7. Development Fabric starts
  8. Development Storage fails

Upon a little bit of investigation I find that it cannot connect to the SQL Express instance against which it was installed - duh.  If you’ve pulled a similar trick then the following should help.  Looking a little more I find is that there is a config file (C:\Program Files\Windows Azure SDK\v1.0\bin\DevelopmentStorage.exe.config) that contains two elements that seem interesting to me:

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

and

  <service name="Table"
               url="https://127.0.0.1:10002/"
                     dbServer="localhost\SQLExpress"/>
     

So, I changed them to

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

and

<service name="Table"
               url="https://127.0.0.1:10002/"
               dbServer="localhost" />

However, this still doesn’t solve the base problem that I have in that I basically deleted the original data files.  Had I uninstalled and kept the data files I could connect them into the current default instance of SQL Server on the box, but, in fact, I did not have them and they had to be recreated.  This was fortunately easier than I expected it might be.  To finish up the “repair” of my development environment I did the following:

  1. Open Windows Azure SDK Environment command prompt
  2. Execute the command dsinit /sqlinstance:. /forcecreate /user:[windows account name]

Now you should have the needed database on the default instance and you should be able to debug your project successfully as the development storage should work again.

Comments

  • Anonymous
    December 04, 2013
    Thank you so much. This post really helped.