Skip to content

Azure: How to imgrate your Website project (to the cloud)

October 1, 2009

If you are migrating your Website Project to Azure, you are quite likely to have the problem like I did – Microsoft VS.NET only supports WebRole and WorkerRole.

Azure WebRole model is similar to WebApplication model in VS.NET, all the classes are compiled into single assembly. First of all, if you want to use all of your files under WebSite project for WebRole, you have to port the files to WebApplication first. In order to do that, you have to go through number of steps to convert WebSite to WebApplication and include all the converted files into your WebRole project, there isn’t an easy way for copy-and-paste for Website to WebApplication conversion, here is the link for the conversion

http://geekswithblogs.net/Mohamed/archive/2008/08/03/converting-vs-2008-website-to-web-application.aspx

If you don’t feel comfortable to convert your project( like I did, and it’s quite error-prone), you have to manually pack your .aspx pages and dlls into the container file.

Here is the few steps:

(1) Publish your Website project to a folder (for my case is “PrecompiledWeb\WebSite1“, which resides in the sub folder of your azure project)

(2) Modify your service definition(.csdef), adding a webrole

<WebRole name=”WebSite1″ enableNativeCodeExecution=”true”>
<InputEndpoints>
<InputEndpoint name=”HttpIn” protocol=”http” port=”80″ />
</InputEndpoints>
<ConfigurationSettings />
</WebRole>

(3) Run the following command(CSPack) at command prompt

cspack CloudService1\ServiceDefinition.csdef /role:WebRole4;WebRole4 /role:WorkerRole1;WorkerRole1\bin\Debug;WorkerRole1.dll /role:WebSite1;PrecompiledWeb\WebSite1 /out:CloudService1.cspkg /generateConfigurationFile:”ServiceConfig.cscfg”

(4) You are done!

Go Cloud

September 25, 2009

It has been a while Microsoft releasing its first cloud platform – Azure. For a small start up like us has been using Microsoft technologies to build our services for couple of years now to embrace a new platform, it always requires some additional efforts and time for the migration.

We think that the effort is justifiable to move to cloud, because we were struggling to build a scalable platform and we are a small start up with limited resources – the investment has to be worthwhile. Aside from scalability advantage, most of the cloud vendors like Amazon, Joyent, Microsoft offer pay-as-you-go charging model.

A recent interview with Microsoft CEO, Steve Ballmer, he regards cloud computing as “fundamental shift in the computing paradigm.”

Follow

Get every new post delivered to your Inbox.