Moving your ASP.NET Application to Windows Azure – Part I

Earlier I had written 2 posts – Taking your Northwind Database to SQL Azure and binding it to an ASP.NET GridView Part I and Part II .  I thought, I will complete the series with a post on moving your ASP.NET Application as well to Windows Azure making it a truly cloud based application.

Before we start, there are a bunch of things that you would need to do.  First and foremost, you would need a Token for Windows Azure.  You can request for a free token for Windows Azure from here after providing your Live ID and a few more details.   I am not aware of the current time it takes for receiving a token but in the past it used to be 24 hours.

Similarly, if you want to have SQL Azure Tokens, you can get it from here and then login to https://sql.azure.com to redeem the token once you receive the same.  (if you had migrated your SQL Database to SQL Azure as per my earlier posts, you would have done these already)

Once you receive the tokens for Windows Azure, you would need to visit the http://lx.azure.microsoft.com/ and sign in with your Live ID that you used for registering for the tokens.  Once you login, you would be able to see a screen as below

image

Since you haven’t claimed the tokens, there won’t be any projects listed here.  You can click on “Account” tab and click on “Manage my Tokens” in the bottom to claim the tokens for Windows Azure.  With this token you can create 1 hosted services account and 2 blob storage accounts.

And, for development purposes, you would require Visual Studio 2008 SP1 and the Windows Azure Tools for Visual Studio 2008 SP1.  You can download the tools from here

For the rest of the post, I am going to assume that you received the tokens for Windows Azure and SQL Azure and have already migrated the northwind sample database to SQL Azure and did the configuration steps as per Part I and Part II of my posts as well as created the web application with a simple gridview that binds to the SQL Azure database.

Once you login to the portal http://lx.portal.azure.com and click on the Project you will get a screen similar to the one below

image

In the above, you can see that, I already have a blob account by name “harishblobs” that I would use to store heavy data such as video etc., But the point of your interest would be the “New Service” link that is on the top.  You would need this when you are migrating your ASP.NET Application in the steps to follow.

If all is done as per my earlier steps, you have your ASP.NET Application with a simple webform that has a GridView.  The GridView is bound to a SQL DataSource and the SQL DataSource initially was configured to the use the local database instance of northwind database and thereafter, you had changed the connection string pointing it to the SQL Azure database.

The next step is to add a Cloud Project to your ASP.NET Application.  In Visual Studio 2008, click on “File – Add – New Project” and choose “Cloud Service”

image

This would provide a screen to chose the Role type as below

image

Since we already have an existing ASP.NET Application,we just have to click “Ok” with “ASP.NET Web Role” highlighted as you see in the screen.  Make sure the “Cloud Service Solution” is blank as per the above screen.

With this step you will find that a “CloudService1” has been added to the solution and it has a “Roles” folder as well as 2 configuration files. 

Right Click on the Roles and select “Add – Web Role Project in Solution”

image

This would automatically add the existing Web Application in your solution to the Cloud project under “Roles” (you will only see a cloud project icon with the name of your existing web application – the files won’t move)

Once this step is done, you just have to build the whole solution once.  If all is well, and you run the solution, you will get the page but there would be a series of notifications as well as status messages on the Visual Studio bar in the bottom indicating the steps the tool is doing.

After a few minutes you would get an URL which is http://127.x.x.x that has your page.  Remember, we earlier had the localhost URL.  This is the Fabric Controller simulation of your application running on the cloud.  You can click on the notification area in your task bar to open the “Development Fabric UI” (The Development Fabric is something that gets installed when you install the Windows Azure SDK).  You can expand the “Service Deployments” icon in the Development Fabric and then expand the subsequent node to the see the instances running.  By default it shows 0 which indicates one instance of your application is running. You can change is number from the “ServiceConfiguration.cscfg” file in the Cloud Project and set the “Instances Count” to 3 or 4 or whatever you like.  Once you do that and re-run the solution you would get a simulation screen in the Fabric Controller as below

image

Make sure you change back the number of instances to "1" in the file above before publishing to Windows Azure, since in production, as of CTP, it supports only 1 instance. 

With this, we are all set to go the Cloud :)   Considering the length of the post, I would put the next set of steps in another post to follow. Read next post

Cheers !!!

posted @ Friday, December 18, 2009 1:48 AM

Print

Comments on this entry:

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by George Meng at 12/18/2009 4:04 AM
Gravatar
Really really cool!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by dude at 12/18/2009 4:59 PM
Gravatar
Really exciting stuff, but I am too hesitant to invest in learning something that will probably work in a completly different way in 6 months from now.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by DefaultDotAspx.com at 12/23/2009 12:13 AM
Gravatar
This post has been added to the Articles section in Default.aspx website (www.defaultdotaspx.com).

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Train Horn at 12/24/2009 1:17 AM
Gravatar
Hey thanks for sharing this tutorial. Worked for me.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Prasanna at 12/28/2009 11:51 AM
Gravatar
Great information.
Few Suggestions:

1. Each of the images on this page when clicked, should open an image which need to be little bigger in order to ease the readibility

2. If you are highlighting/discussing about a section of an image, circling that item/text with RED color will help readibility

3. A Simple Video of this will reduce reading time. This tool can help record
Screen Recorder - http://technet.microsoft.com/en-us/magazine/2009.03.utilityspotlight2.aspx?pr=blog

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Sight Glass at 1/1/2010 6:42 PM
Gravatar
Awesome post! I will try on it!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by jame dino at 1/2/2010 9:49 AM
Gravatar
Well, it is very useful information shared. Thanks a lots.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by ronodi at 1/3/2010 5:15 AM
Gravatar
It is quite interesting and very useful. Thanks.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by train horn at 1/4/2010 12:45 PM
Gravatar
Again another happy reader. Very helpful. But I do agree with dude - not sure if ill spend too much time on this??

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by online casino baer at 1/9/2010 6:48 AM
Gravatar
Great solution thanks

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Tiens at 1/14/2010 8:29 PM
Gravatar
That sounds very interesting

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Miz at 1/14/2010 8:32 PM
Gravatar
Looks like a very interesting solution technology. Thanks for sharing

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Josh Gold at 1/15/2010 5:27 AM
Gravatar
This is a really great tutorial, thanks.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by saddles for sale at 1/25/2010 8:52 PM
Gravatar
Yea I also agree with 'dude' - very interesting, but not sure if its worth the time?

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Nutritional Supplement at 1/26/2010 2:32 PM
Gravatar
This is what I love about the Web: you need to find a way to do something, you do a Google search and voila, you find it. Thanks so much for posting this information. It worked for me.

I appreciate it.

GR

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by sunglasses uk at 1/28/2010 9:53 PM
Gravatar
Yea I'm starting to agree with the others, not 100% sure if its worth the time?

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by James at 1/28/2010 9:55 PM
Gravatar
Haha, I also like the comment above the last one

sunglasses uk

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Temporary Health Insurance at 1/28/2010 10:23 PM
Gravatar
Great solution thanks

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by barry at 1/28/2010 10:25 PM
Gravatar
Great solution thanks
Temporary Health Insurance

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Parveen Punia at 2/2/2010 2:34 AM
Gravatar
Hi
great post..it helps me alot thanks.

actually i am facing an issue:

i have followed all these steps given by you.
But when i build cloud service it opens the window with ip http://127.1..... start.aspx.
But it does not show any content that i have wrote on start.aspx.Like i wrote "Hello World" start.aspx.. but it is not showing .. it just shwoing a blank page.
Plz help

Thanks
Parveen Punia

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Se Tv Online at 2/3/2010 10:43 AM
Gravatar
Really cool stuff!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by pawan at 2/3/2010 7:42 PM
Gravatar
hi nice artical.is there anything which could help me in how to configure load balancer in azure

pawan

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Play Kitchens at 2/4/2010 8:04 AM
Gravatar
Thanks for putting this in a clear concise format. I appreciate it!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Sarasota SEO at 2/7/2010 2:27 AM
Gravatar
We are web design firm and are looking forward to using Windows Azure.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Kreditantrag at 2/11/2010 9:11 AM
Gravatar
Why do you move it?

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Bonusprogramm at 2/11/2010 12:24 PM
Gravatar
We dont know anything abou this app!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Trikot.com at 2/11/2010 7:40 PM
Gravatar
Thank you for this tutorial. Its very useful for all those woh use Windows Azure or who will to use is in the near time.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Liebeskummer at 2/12/2010 8:54 AM
Gravatar
He is right ;)

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Ex zurück gewinnen at 2/12/2010 8:55 AM
Gravatar
We had the same probs with this....

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Writing Jobs at 2/17/2010 12:34 AM
Gravatar
And I agree!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Snel Geld Lenen at 2/19/2010 1:33 AM
Gravatar
That was very helpfull thanks. Was struggling to find a solution. But was able to solve the problem.
Cheers

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Kreditkarten at 2/27/2010 2:53 AM
Gravatar
It´s very useful tool and it works. I´ve searched a long time for that.
Tanks for that.
Keep on!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Sarasota wedding planner at 2/28/2010 11:12 AM
Gravatar
Thanks for this! I'm moving to .NET from php, and so far I'm loving it.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Cayenne Pepper at 3/2/2010 2:41 PM
Gravatar
Excellent information with superb visuals. (Show and tell is better than just tell, in my view -- especially with technical nuances.)

Suggestion: If you are focusing on a particular section of an image or test, I'd like to suggest you include some graphic like an arrow or a circle or something that draws attention to that. Most technical people are logical/linear thinkers and that will help.

Just a thought,
Glenn R.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Electric Cigarettes at 3/4/2010 12:24 PM
Gravatar
Helped a lot, thanks. Azure is really cool and got awesome user interface. Helps the beginners like me.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Gainesville Alarm Monitoring at 3/4/2010 12:58 PM
Gravatar
Thank with the help!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Casinomeisterschaft at 3/4/2010 1:05 PM
Gravatar
We just used it for 3 years :-)

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Onlineromme at 3/4/2010 1:06 PM
Gravatar
Windows Azure?!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Pokerturniere at 3/4/2010 1:07 PM
Gravatar
Its very great ;)

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Online Casino at 3/7/2010 2:23 AM
Gravatar
I dont know anything abou this app!
The post was informative

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Kredit at 3/7/2010 11:09 PM
Gravatar
Its Azzure!

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Kreditzinsen at 3/7/2010 11:09 PM
Gravatar
Hello Again ;)

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Finanzen at 3/7/2010 11:10 PM
Gravatar
great =)

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Geld at 3/7/2010 11:10 PM
Gravatar
Taking Azzure?

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Konto at 3/7/2010 11:16 PM
Gravatar
Yeah Azzure ;)

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Jack Lalanne Power Juicer at 3/8/2010 1:31 AM
Gravatar
This is a very helpfull website. It helped me solving loads of problem. I can only recommend this website.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by new energy drink at 3/9/2010 8:35 AM
Gravatar
That is very useful information. I didn't know how to move it at first.

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Jacob at 3/10/2010 9:44 AM
Gravatar
this is really cool :D

Jacob
organic remedies for eczema eczema help

# re: Moving your ASP.NET Application to Windows Azure – Part I

Left by Saddles For Sale at 3/13/2010 2:02 AM
Gravatar
Thanks for taking so much time to help the masses...Try using Camtasia for video if you want but this doesn't really need it. It would probably be as time consuming as inserting screenshots.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«March»
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910