Microsoft Azure - Websites

There is a detailed description of how to create websites in Azure in the chapter, ‘Compute Module’. Azure websites service is named ‘Web Apps’ everywhere in the management portal so don’t get confused. This chapter will discuss few more terms associated with Azure websites. In normal hosting environment, developers usually encounter problem when they deploy their websites in production. Azure websites service ensures that developers encounter least problems while deploying their websites. Also, Azure website service comes under PaaS (Platform as a Service). This means that websites can be deployed without actually having a full-fledged infrastructure.

Create a Website in Azure Management Portal

Just to reconnect with the website creation, let’s take a look at these steps of how to create a website in Azure Management portal.

Step 1 − Login to your management portal.

Step 2 − Click ‘New’ at the left bottom corner of the screen → Compute → Web Apps → Quick Create.

Create Website AMP

Step 3 − Enter the details as shown in the picture above and click ‘Create Web App’.

Step 4 − Go back to websites in your management portal and you will see it listed. Click the URL.

Web Apps

You will be taken to the website that you just created.

Web Apps Successfull

Deploying Azure Website from Visual Studio

Let’s publish our website from Visual Studio in the domain name we just created. After a website or web application is created in Visual Studio.

Step 1 − Go to Solution Explorer and right click on the website/webapp name.

Step 2 − Choose ‘publish’.

Website from Visual Studio

Step 3 − In this step, you need to connect to Azure subscription account in order. Click ‘Import’.

Publish Web

Step 4 − Click ‘Add Azure Subscription’.

Add Azure Subscription

Step 5 − For the first time, you will have to ‘Download Subscription file’.

Download Subscription File

Step 6 − The above step will download a file with extension .publishsetting on your computer (if you are not logged in, it will ask you to login before downloading).

Step 7 − Come back to the same pop-up and now browse for the file that was just downloaded.

Website from Visual Studio

Step 8 − Now expand the dropdown and you will see the websites available in your subscription. As in the picture below you can see two websites. Let’s select ‘tutorialsPoint’.

Website from Visual Studio

Step 9 − On the following screen, leave the defaults on. There are many options for public methods. We need ‘Web Deploy’ method here. Click ‘Validate Connection’.

Step 10 − On the next screen, again the leave the defaults on.

Step 11 − Finally on the last screen, click publish.

Website from Visual Studio

Step 12 − Go to the URL of website and you will see your content.

Website from Visual Studio

You can see how easy it is to deploy a website in Azure using Visual Studio. You can make changes in Visual Studio and publish it from there itself. This makes testing of applications very easy.

Monitoring the Website

In the management portal, if you go to the website’s dashboard you can see the figures related to the website. You can control lots of things related to your website from this section of your management portal. You can see the website metrics, create backup, configure setting, and scale the website.

Step 1 − To see the website metric, select monitor from top menu and you will see the following screen.

Monitoring the Website

Step 2 − Go to the website and select ‘Dashboard’ from the top menu.

Step 3 − Scroll down and you will see the following information.

Monitoring the Website

Staged Publishing

Windows Azure enables the deployment of a website in stages. You can create the deployment slots.

Staged Publishing

Add a Deployment Slot for Testing Before Production

Basically, this feature allows you to deploy your website in a separate slot for testing purpose and then switch the slot. If anything goes wrong, you can simply go back to the previous version by changing the slot. Sometimes, applications don’t behave well as they are expected to at a large scale, this feature comes handy in such situations. This makes deployment tasks very easy for developers and organizations.