A lots of developer often get confused how to host website in Azure VM. In this article I am showing step by step process.
Fire up the Visual Studio and from the File menu, click New Project. This will bring the “New Project” window.
- In theNew Project dialog box, choose either Visual Basic or Visual C# as your main programming language. I am going to stick with C# for this demo. Collapse the Visual C# and click Cloud > NET Web Application.
- Make sure that.NET Framework 4.5 is selected as the target framework then click OK. The next screen will show you all the available templates. For the demonstration of this tutorial I will simply pick MVC as my template. Select Virtual Machine from the drop down.
Note: (The check box caption might be Host in the cloud or Create remote resources. In either case the effect is the same.)
- As soon you hit the OK button Visual Studio might ask you to sign in to your azure account. Expand the More Options and select Microsoft Azure Virtual Machines.
- Up on your login you will see the “Create virtual machine on Microsoft Azure” dialog page. Give a suitable DNS name. If the DNS name is available you will see a green tick mark right after your site name. Select an Image that fits your criteria. Check the Enable IIS and Web Deploy option. Choose Size that can handle your load.
- Once you click OK in step 4 you will get a confirmation dialog box that tells you that your VM is in progress.
- Jump into your VM that you have just created using Visual Studio Wizard. From the Server Manager > Manage > Add Role and Features.
- Install the feature Simple TCP/IP Services from Add Roles and Features Wizard.
- Jump to the Azure portal and dig into your Virtual Machine. Check the ENDPOINTS and pay attention to the WebDeploy port.
- Go back to Visual Studio. Select your million dollar project that you want to host in your Azure VM. Right click in the project and GO for Publish… option.
- This will warn you about certificate issue. Click Accept.
- Enter your site name with the suffix .cloudapp.net
You are done ! Congratulation ! Your Million Dollar site is now in Live and its running from your hosted Azure VM.
Thats all for today. Stay tuned for other cool Azure topic 🙂