Deploy A Simple Azure Website From Visual Studio

Introduction

We'll simply discuss how to create and deploy an Azure website from Visual Studio. Those who don't have any idea what azure is should read this article first. This will help them to be clear about what Azure is and why we should use this platform for deploying our websites.

Pre-Requisites

Steps

  • Create a new ASP.NET Web Application project. Choose an empty template and check the web forms box to add its folders and core references. Make sure the Host in the Cloud option is checked on the right and select Web App from the drop-down menu. Click OK.
    Web form
  • After completing the above step, a new window will pop up where you'll have to provide credentials of your Azure account, tweak with some other settings, and click OK. See the following screenshot to follow along.
    Azure account
  • Your web app is now deployed. You can check in your Azure management portal. You'll see a default web page by opening the provided link.
     Azure management
  • Let us do very few changes in our page and see how we can publish it from Visual Studio. Right-click on your project name in Solution Explorer, add a new web form via add item. Drop a textbox and button on the designer view. Double-click on the button to edit its event handler.
    Code
  • For publishing, click on Build > Publish "YourWebsiteName". A new window will open up, leave everything unchanged, and click next (2x) and then publish. You'd be able to see the changes you've made live on your website link (which appeared in the Azure portal).
    YourWebsiteName

Summary

This is the easiest example we've done to understand the deployment of a website on Azure. Besides Azure web apps, you can also use Azure cloud services and Azure virtual machines to deploy your website.

Have any questions? Please comment below.


Similar Articles