LinkedIn

Monday, 20 February 2012

My weekend (I'm a geek) of deploying my new Kite Boarding site to Windows Azure with an Azure SQL database, membership and blob storage

Good Morning,

I just thought I'd post to my blog after a long period of being to lazy to do it and also being too busy at work to get around to it.

I spent part of the weekend deploying my latest side project to Azure. I won't tell you what it's all about until I have it all polished and shiny as right now it's a definite work in progress.

What I have deployed:
  • MVC 3, Html5, Razor website - I'm thinking about moving to MVC 4 as I think the beta just came out.
  • The site runs off Entity Framework 4.3 and I used code first poco classes with DBContext.
  • Users and Roles are managed by  http://nuget.org/packages/System.Web.Providers 
  • My custom data is stored an an Azure Sql relational database 
I posted the following questions on MSDN and have now got the answers I need so i'll update the questhions with answers. As I was an Azure newbie a 2 weeks ago, these questions now seem a bit lame to me!!

Questions:
  • I have used an Azure SQL relational database for my database. They talk a lot about table storage. I assume I have done the right thing in using a relational database?
    Ok, so this one was easy. Whilst I could probably use table storage to store me data (xxx.table.core.windows.net) I am not ready to ditch my relational database way of thinking. My site will have many tables with relationships so for now I am playing it safe and using SQL Azure. I have, however, used blob storage (xxx.blob.core.windows.net) to store the gallery images I need for my site. So, and I may be wrong here, if I had a list of people whom each had a picture attached to their relational database record, I think I could store the blob Url in a field in their record and, when rendering, iterate the records and retrieve the blob image from my storage account.
  • I have used the http://nuget.org/packages/System.Web.Providers to manage users and roles. Once I deployed to Azure using the same database in my web.release.config for my custom data AND the membership tables it all works great. I can register a new user using the standard MVC 3 register user view and I can see this new user in my Users table inside the asp membership table.
    My question here then: and I have Googled this but cant find it, is how do I manage my users and roles on the azure server as I would when I use the asp.netwebadminfiles/default.aspx in Visual Studio? Do I, and I plan to this anyway down the line, write my own custom membership management code to do this or can I use an instance of asp.netwebadminfiles/default.aspx on the server somewhere?
    I figured this one out too. Although there are ways to use the netwebadminfiles tool to manage users and there is also third party code that can do this for you, ultimately I want to manage these users myself. I will build all my user and role code into the site.
  • When I deployed for the first time it created my web svc role on Azure AND my Sql database mentioned above. Lets say I have the site live for a few months and want to redeploy, will my membership and custom data get wiped out? What if a deploy schema changes to my database, will this be taken care of without affecting my data. I know I can use a one way data sync to get the data onto local but im sure I would not have to worry about this?Not 100% sure on this one but I now know that firstly, I don't have to redeploy / publish the whole site, storage and database every time I make a change. I can use Visual Studio WebDeploy to push new changes to my site. If I needed to sync data from my local I think I could use the Data Sync in the Azure portal and I assume I could manage my users via SQL mambership stored procs. until I get all my membership screens written.
thanks
RuSs