Deploy your web application to Windows Azure with Visual Studio
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
- Visual Studio 2012, 2013 (express and up) - Download Visual Studio
- Windows Azure
PUBLISHING A WEB APPLICATION TO WINDOWS AZURE WITH VISUAL STUDIO
Creating a Windows Azure Web Site
Navigate to https://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:
Select +NEW at the bottom left hand corner:
Select COMPUTE -> WEB SITE -> QUICK CREATE, add a name under URL and finally check CREATE WEB SITE:
Verify the site is created and running and flip over to your Visual Studio development environment:
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 https://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:
Select the web site you created in the previous steps:
Select DASHBOARD and then select “Download the publish profile”:
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”:
Select “Import… ” and navigate to the publish file you saved and select “Next > ”
The Connection page will pull information from the publish file and populate the fields for you. Verify the details and select “Next > ”
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 > ”
Finally the Preview page provides a view of all the files to be uploaded to your Windows Azure Web Site:
Visual Studio will give you a log of information as it deploys to Windows Azure:
Once the web application is deployed, navigate to the site URL (in my case I used a self-signed certificate for SSO):
Here is my site:
Congratulations, you’ve deployed a web application to Windows Azure!
ADDITIONAL RESOURCES
Visual Studio 2013 - https://www.microsoft.com/visualstudio/eng/visual-studio-2013
Windows Azure Web Sites - https://www.windowsazure.com/en-us/solutions/web/