Host your website in Azure


Website hosting is one of the most essential component for making your website online. The website hosting can be done through any of the web registrars like Godaddy, BigRocks but when you plan to host your website on these registrars you will first have to decide either to go with Windows or Linux hosting plan and then select the subscription(the plan goes from 1 month to 5 years).

In case of  Azure, you can just log on to your Azure account, host the website & can use pay as you go option which only charges if your website is online. So, lets see how a website can be hosted on Azure. Here i am using the old azure portal (feels more comfortable with it, personal choice :)) but you can use the new one the option are the same.

When hosting the website in Azure we have to create a Web app which is a kind of repository which will hold all the files required for the website. So, the steps goes like :-

1. We will first create the Web app.
2. Then we will upload our website to the web app.

So, goto azure.microsoft.com & click on "MY ACCOUNT"


 Click on Management portal


Login to the console


 After logging in all the items which are created in the azure subscription will be displayed.


 Click on the "+ NEW" icon on the left bottom corner of the screen. Select COMPUTE/WEB APP/QUICK CREATE/

Add a URL this will be the url which will be used to access the website(You can use a custom domain later) add a "APP SERVICE PLAN" after the update is done click on "CREATE WEB APP" to create the Web app.


You can check the status of Web app at the bottom of the screen, once it's created just click on OK to finish.


Once the web app is created, goto WEB APPS and the new web app should be created. Click on that to view the dashboard.


 Click on Dashboard.


The URL will be mentioned there. Click on the URL to check the default website.


Here is our default website provided by Azure.



Now we will change the default website & upload our website there, Go to Dashboard again & click on "Reset your deployment credentials".


 Provide a usename & password to access the Web app - FTP.


After the username/password is set it will appear under DEPLOYMENT/ FTP USER


Check the "FTP HOST NAME" this url is the one using which we will access the web app FTP.


Copy the FTP link.


If you are on a Windows 8 or Windows 10 machine just open Windows Explore & paste the URL.


It will connect to the URL & will ask you to provide the Username & password. Provide the Username/Password & click on Log on.


After verifying the credentials , it will show you the folders existing in the FTP. Site is the folder we are interested in. Double click on Site.


 Click on wwwroot.


Remove the files that exist & just copy paste your website files/folders in this folder.

 Once its complete, close the folder.


Now, go back to the azure portal & click on CONFIGURE then scroll down to "Default Documents Section"


In default document section you can define the main page of your website, bring it to the top using the up down arrow at the left. Save the configuration.


Again access the website, now your website should be up.


You can add your custom domain to the website but for that you need to have a paid subscription for Azure.

No comments:

Post a Comment