2 minutes reading time (425 words)

Create a Web App using Azure CLI

Create an App Service Plan and Web App using Azure CLI. 

Create Web App resources 

Connect to Cloud Shell

Sign into the Azure admin portal
https://portal.azure.com

Open Cloud Shell - Create storage

Change to Bash shell

Create a Resource Group

# Define resource group variables
rgName=www-planetexpress-rg
rgLocation=ukwest 

# Create resource group and output results to a table 
az group create --name $rgName --location $rgLocation --output table
 

Create a Storage Account

# Define storage account variables
saName=wwwplanetexpresssa
rgName=www-planetexpress-rg
location=ukwest
sku=Standard_LRS
kind=StorageV2

# create storage account
az storage account create --name $saName --resource-group $rgName --location $location --sku $sku --kind $kind 

Create an App Service Plan

An App Service Plan defines the compute resources used to run Web Apps (similar to a server farm). You can choose Windows or Linux operating systems, the number of Virtual Machine instances (workers) and the size of VMs.

  • Workers are the virtual machines that run your apps. 
  • Each worker unit is a VM instance or node in the server farm, and each one has a cost.
  • You'll need to create an App Service plan before you can create a Web App

The options used in this guide are examples for testing only. For production websites, you might want to add these options: --sku --number-of-workers

# Create an App service plan
az appservice plan create -g www-planetexpress-rg -n www-planetexpress-plan  

This command will create a default Windows App service plan, B1:1 with 1 worker if other options are not specified.

Create a Web App

Create a Web App that uses the App Service Plan we created in the previous step -p www-planetexpress-plan

# Create a web app 
az webapp create -g www-planetexpress-rg -p www-planetexpress-plan -n www-planetexpress-app 

You can stop / restart your web app from the Overview tab

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Saturday, 23 September 2023
You can help support this website by buying me a coffee!
Buy Me A Coffee