Creating an Azure website using  Portal, Powershell and CLI

Creating an Azure website on Microsoft Azure Cloud starts with creating the unique DNS name, specifying the region the website will run in on Microsoft Azure Cloud starts with creating the unique DNS name, specifying the region the website will run in, and adding resources such as a Microsoft Azure SQL Database or Microsoft Azure Storage account. In other words, you are designing the infrastructure for the website that the web application will utlilize. These are the equivalent approach you take in an on-premises environment where you create a website in IIS Manager. When you do this, you simply create the site without any code. Later, application code is published to the site that users can reach through their browser.

A Microsoft Azure website can be created using a variety of tools, such as the following:

  • Microsoft Azure management portal at
  • Azure PowerShell cmdlets
  • Many other UI and command-line tools

Creating an Azure website using the Azure management portal

Using the Azure management portal to create an Azure website provides is an easiest option as it provides a rich and powerful UI experience. You can choose to create your website using a variety of templates. Some templates provide the option to include a database resource such as a SQL Database, MySQL Database, or Azure Storage account. Other templates can be used to create a fully functioning website for popular blogging and content management systems (CMSs), e-commerce, and more. All templates available are in the Web page in the Azure Gallery, as shown in Figure 1.

Creating an azure website 1

FIGURE 1 Web page in the Azure Gallery showing some of the templates available for creating an Azure website

Creating an Azure website using Azure PowerShell

Creating an Azure website using the Azure PowerShell cmdlets requires that you know the location (or region) you want to create the site in and a unique name for the site. To determine
the website locations that are available to your Azure subscription, use the following Azure PowerShell cmdlet.


An Azure PowerShell cmdlet reference is available at

You can also get detailed help on a cmdlet using the PowerShell Get-Help cmdlet.

The result will be a list of locations that are available to your subscription. To determine if an Azure website name already exists, use the following Azure PowerShell command.

Test-AzureName -Website "contoso-web"

The result will be either true or false. If it is true, then the name speciied already exists and therefore cannot be used. If it is false, then the Azure website name does not exist and therefore would be a valid unique name you can use. To create the website, use the New-AzureWebsite cmdlet, specifying the location and name parameters as shown in the following example.

$wsLocation = "West US"
$wsName = "contoso-web"
New-AzureWebsite -Location $wsLocation -Name $wsName

All Azure Websites are created in the domain. If you name your website Contoso-web, it will be reachable using the URL

This article is a part of 70-533 Implementing Microsoft Azure Infrastructure Solutions Prep course.

More Articles included in this course are


Azure Cross-Platform Command-Line Interface

Using the Azure Cross-Platform Command-Line Interface tools for configuration tasks The Azure PowerShell cmdlets can be referenced for automating jobs ...
Read More

Diagnostic logging for Applications and Sites in Azure

Enabling Diagnostic Logging for Applications in Azure Diagnostic logging cannot be supported by default. It’s completely up to you whether ...
Read More

Retrieving diagnostic logs in Azure

Steps for retrieving diagnostic logs in Azure There are a number of choices to retrieve diagnostics logs or simply observing ...
Read More

Streaming Logs in Azure

Viewing streaming logs in Azure This article explains how can you view streaming logs in Azure. Sometimes it is preferable ...
Read More

Azure website resources

Monitoring Azure website resources The management portal provides rich and visually appealing screens to monitor your Azure Website resources included ...
Read More

Practice Tests in this course are

No posts found.