As I wrote in a previous post I am running my BlogEngine.NET blog with SQL Azure as data storage. How, you may ask. Well, don't worry, I will explain it to you in this post…
You could run BlogEngine.NET entirely on XML or SQL Server. Well, actually you could also run it on SQLite, MySQL and VistaDB Express. I have tried XML, SQL Server and MySQL and they all work great, and since there are setup scripts and instructions for each data storage you could be up and running within minutes.
I am not sure which versions of SQL Server that BlogEngine.NET supports, but it worked like a charm on SQL Server 2008…
But now back to the topic, SQL Azure. In short, SQL Azure is a fully relational database in the cloud, built on SQL Server® technologies. If you want to know about SQL Azure I recommend reading this article.
To get started with SQL Azure (and Windows Azure, a cloud platform where you could host ASP.NET applications. Most likely I will write about this in the future…) you have to create a Windows Azure account and get an invitation code. You should also download the Windows Azure Platform Training Kit, to get access to samples, demos and presentations.
When you have your account you can visit http://sql.azure.com and sign in with your Live ID. Then create the databases you need. For this case you only need one database.
Next step is to run the SQL setup script to create all the tables and data that are needed. The SQL Azure database does not support all features in SQL Server so the setup script provided by BlogEngine.NET needs to be modified to work on SQL Azure.
I found a nice tool on CodePlex, SQL Azure Migration Wizard, that helps you migrate local SQL Server 2005/2008 databases to SQ Azure. Just what I need!
Download and run the tool. As “Source” select the setup script file, and check the “Parse TSQL for SQL Azure Incompatibilities” option. Hit next and the SQL script is generated. But that was not enough, so I had do some more changes to the script before I was able to run it on my SQL Azure database. You could download a working version of the script at the end of this post (Runs on my cloud…).
When you got the database with all its tables and data all you have to do now is update the web.config file of the blog. In the setup folder for SQL Server you find instructions on what to add. Also add a new connectionString tag, you will get the connection string to your SQL Azure database from the sql.azure.com page. Save the web.config file and visit your blog. Bang! you are in the cloud, or at least your posts…:)
BlogEngine15SqlAzure.sql (26.07 kb)
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Developmentsql azure, blogengine, sql server 2008
|
|
|
|