Hosting A Website In Microsoft Azure Using Visual Studio

Introduction

Creating a Website is one step, but hosting a web site is something different. This article helps you in learning one of the methods to host websites in Visual Studio to Azure. For this purpose, you need a basic subscription in Azure like a dream spark subscription or the free trail. 
 
Creating Web apps in Azure

Login to your Microsoft Azure portal. Now, you have to create a new deployment environment for your website. Hence, you have to create a new web app location. To create a new web app, simply click on the "+" button in the top left corner of the portal. You will then find a bunch of menus. In those, give a unique name for your web app, which will act as a link to access your website. Now, select the resource group, the subscription and click create button. This will now create a new web app in Azure. The screenshots given below will give an idea about it.

 
 
Downloading the publisher profile

Now, you have created the Web app. Once the app gets completely deployed in the portal, it will be displayed in the dashboard of the portal. Now, click on the web app which you created. When you click in the app, you will get a small menu related to the settings of the application. In this, click on the more option in the top right corner of the page. You will find an option called Download Publisher Profile. Click on the menu and a small file will downloaded. Find the location of the file and it will help you in publishing your website. Look at the screenshot given below for more information. 

 

Publishing Website from Visual Studio

Let us assume that the small page in the screenshot given below is a website. Let it be the complete website which we want to publish. To publish the site, right click on the project name which you have given to your website in Visual Studio and select the publish option.

Once you click on the publish menu, you will get a small menu. In this menu, click on Import option. You will be asked to select a file. Click on the Browse button and select the small file, which you have downloaded from Azure portal in the beginning. Now, click on the Next button. Now, a small connection testing menu will appear. Don't change anything in the menu. Just click on the Validate button. The connection with Azure port will be checked and if everything is correct, a small green tick will appear. Once the tick mark appears, click on Publish button. The website will now publish. Look at the screenshots for the steps.

 


Completion

As soon as the deployment gets completed, the website gets published in Azure portal. You can click on the link which you gave for your Azure Web app to reach your website in Azure portal. This is how the website can be published in Azure, using Visual Studio. You can use some other different methods to host the Websites. I will share those with you in further articles. Thank you. 


Recommended Ebook

Azure Web Apps for Developers

Download Now!
Similar Articles