Tuesday, March 25, 2014

How to Deploy ASP.NET web application in Windows Azure Virtual Machine

Are you searching for the steps to deploy ASP.NET web application in windows Azure Virtual Machine? Yes, in this article I am going to give you the step by step procedure to deploy the web application in cloud.
If you are not sure how to create Virtual Machine in Windows Azure you may read my article How to create Virtual Machine in Windows Azure
In this article I am explaining the steps you have to follow after creating the Virtual machine.
As usual first you have to login to the Virtual Machine by login to your Windows Azure account. You may open your Windows Azure account by opening Windows Azure Login Page

Once you login to your account click on Virtual Machine icon at the left menu to display all the Virtual Machine you have created.
image
To avoid additional billing from Microsoft I normally shut down VM once my usage over. So now we will start the Virtual Machine first.
image
Now we will connect to the VM by clicking on the connect button.
Just a refresh regarding the end point, since we are deploying web application in VM one important thing you have to remember is to create the HTTP end point otherwise you may not be able to open the website over the internet. If you are not sure how to create end point please read my earlier article How to create Virtual Machine in Windows Azure
VM WebApp Endpoint
Now we will open Visual Studio 2013 and create a demo website to do the deployment in Windows Azure Virtual Machine. We are not changing anything from the default page except some text as it is just a sample one.
image
Now we will publish this website. Just right click on your project and click on publish.
image
Once you click on Publish, it will open a window where we have select/create the profile. Since we are doing this first time, I am selecting the option New Profile.
VM WebApp publish 1
Enter any name, here I entered the name as DemoVMWebApp.
VM WebApp publish 2
Click Next to select the Publish Method. Here we will do the simple deployment by selecting the option File System from the dropdown list.
image
Since we have selected the Publish Method as File System we have to provide the Target Location. Here we provide the application name as DemoVMWebApp and provide wwwroot as the publish directory.
image
Click Next to select the Configuration. Since we are deploying the application we will select as Release.
VM WebApp publish 4
Click next to open the final Publish screen where you can review the path and also if you require you can navigate back to each option we have selected so far.
VM WebApp publish 5
Finally Click on Publish to deploy the web application in Windows Azure Virtual machine. Let’s check the wwwroot folder for the deployed file to make sure everything deployed properly.
image
Now it’s the time to open IIS and convert the directory created by the deployment to an Application. For that expand Default Web Site and then right click on the folder and then select “Convert to Application


 image
Once you convert to an application just browse the page to make sure it works fine at local host.
image
Now you can see that the webpage opens fine at local host.
VM WebApp Running After Publish
Now it is the time to access the same website over the internet. To access it over the internet you just need to replace the localhost with the DNS name of your virtual machine.
VM WebApp publish 6 
That’s it your demo web application created for testing the Windows Azure is online now!!!
Let me know if you have any doubt in above steps. You are always welcome to contact me or write comment below.

6 comments:

Eunice said...

Hi, when I converted it to a application, it didnt appear next to my folder. Where am i able to look for it?

Karthika Shree said...

Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
Dot Net Training in Chennai

Mithun Mithun said...

Thanks for your informative articel .its very useful
best dot net training in chennai | dot net training in chennai | dot net training and placement in chennai

Priya Kannan said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
Dot Net Training in Chennai

for IT the said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.

sreedevi said...

Your information was very clear. Thank you for sharing
azure Online course