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 https://portal.azure.com
- 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 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 https://msdn.microsoft.com/enus/library/azure/jj554330.aspx.
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 Azurewebsites.net domain. If you name your website Contoso-web, it will be reachable using the URL contoso-web.azurewebsites.net
This article is a part of 70-533 Implementing Microsoft Azure Infrastructure Solutions Prep course.
More Articles included in this course are
Practice Tests in this course are