A day with .Net

My day to day experince in .net

Create a virtual machine in azure and host an asp.net web site.

Posted by vivekcek on November 18, 2012

From this post you will learn how to create a virtual machine in windows azure.Virtual machine’s are the new IaaS(Infrastructure as a Service) feature in azure.Don’t confuse it with VM Role in PaaS(Platform as a Service).

So what is the advantage over PaaS?.
—————————————————–

PaaS constitute Web Role and Worker Role. When you deploy a Web Role azure will create a virtual machine for you and deploy your ASP.NET web site in that virtual machine.

Consider you have a big ASP.NET application. it will be hard to convert that to a web role project. in that case you can create a virtual machine and host your existing application without any change.

Another advantage deploy a share point farm with domain controller can be achieved using VM’s.

You can install 3rd party software like MySQL.

Simply you will get a virtual server you can do anything with that. Not just hosting asp.net.

STEPS
———————

1. Log in to your azure portal.

2. From Menu select ‘Virtual Machines->Create a virtual machine’.

3. From the next window select ‘COMPUTE->VIRTUAL MACHINE->FROM GALLERY’.

4. From gallery select your OS for virtual machine.

5. Give name and credentials for your virtual machine.

6. Give your DNS name for virtual machine. Through this DNS you can access your IIS hosted application. You should associate a storage account with the virtual machine to store OS installation file. In this example i have a storage account named ‘vivu’. If you don’t have any storage account azure will create one automatically when you create a virtual machine.

7. Next you can create an availability set. If you have only one virtual machine you don’t need to specify an availability set. This feature is used for placing virtual machines in different fault domains.

8. After your virtual machine create you can connect to your machine through remote desktop. Which is very simple don’t need any certificates uploaded.

Click connect and save .rdp file and click on that.

9. Give username and password

10. Enable Web Server Role.

11. Enable ASP.NET

12. Now you need to log back your azure management portal. Select your virtual machine and

select EndPoint.Then click ‘AddEndpoint’.You must configure port 80 TCP endpoint for external communication.

13. Select AddEndpoint.

14. Give details of end point.

16. After endpoint is create access ‘.cloudapp.net’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s