Web applications have traditionally been deployed to data center hosted servers (e.g. IIS, Apache, etc.) and published either publicly, internally, or a combination of both.

The process of web deployment has consisted of packing up of web content files, copying them to a web server or servers, and configuring settings on the web host to publish the site properly. There have been improvements over the past several years to make publishing web content easier such as the case with Visual Studio.

Moving applications and services to the cloud has also been a point of discussion over the past couple years. In the beginning, the moving of web content, sites, applications, etc. to the cloud often required a rewrite or it just made sense to rewrite the application because of legacy code. However deployment was never straight forward or required complicated tools/scripts. However, there is a simple method to deploy web applications to the cloud. Using Visual Studio I’ll show you how to deploy a web application to Windows Azure.

 

Dependencies

PUBLISHING A WEB APPLICATION TO WINDOWS AZURE WITH VISUAL STUDIO

 

Creating a Windows Azure Web Site

Navigate to http://manage.windowsazure.com/ and either log into your account or sign up for a trial account.


Once you’ve logged into Windows Azure, you’ll see a variety of options on the left hand navigation. Select WEB SITES from the list:

clip_image001


Select +NEW at the bottom left hand corner:

clip_image002

Select COMPUTE -> WEB SITE -> QUICK CREATE, add a name under URL and finally check CREATE WEB SITE:

clip_image004

 

Verify the site is created and running and flip over to your Visual Studio development environment:

clip_image006

Create a web application or open an existing web application using Visual Studio. When you’re ready to publish the web application follow the steps below:

PUBLISHING PROCESS

Remember that web site you created at the beginning? On the Profile Page you’ll want to utilize a publishing profile from your Windows Azure account. I’ll describe how to do that next.

 

DOWNLOAD PUBLISHING FILE

Let's take a moment to download the publishing file…

Navigate to http://manage.windowsazure.com/ and either log into your account or sign up for a trial account.

Once you’ve logged into Windows Azure, you’ll see a variety of options on the left hand navigation. Select WEB SITES from the list:

clip_image001[1]

 

Select the web site you created in the previous steps:

clip_image008

 

Select DASHBOARD and then select “Download the publish profile”:

clip_image010


Save the publish profile to the machine Visual Studio is installed on.

 

OK, back to the Publish Web process in Visual Studio

Open up Visual Studio, load your completed web application, and select BUILD from the menu and then “Publish Selection”:

clip_image012

 

Select “Import…” and navigate to the publish file you saved and select “Next >

clip_image014

 

The Connection page will pull information from the publish file and populate the fields for you. Verify the details and select “Next >

clip_image016

 

The Settings page provides you an option to deploy as a Release or Debug as well as a place to define a database. Configure to suit your needs and select “Next >

clip_image018

 

Finally the Preview page provides a view of all the files to be uploaded to your Windows Azure Web Site:

clip_image020

 

Visual Studio will give you a log of information as it deploys to Windows Azure:

clip_image022

 

Once the web application is deployed, navigate to the site URL (in my case I used a self-signed certificate for SSO):

clip_image024

 

Here is my site:

clip_image026

 

Congratulations, you’ve deployed a web application to Windows Azure!


ADDITIONAL RESOURCES

Visual Studio 2013 - http://www.microsoft.com/visualstudio/eng/visual-studio-2013

Windows Azure Web Sites - http://www.windowsazure.com/en-us/solutions/web/