Azure CLI 2 cheatsheet

Azure CLI 2: Web apps, storage and databases

7 common Azure CLI 2 tasks.

Deploy a web app from a folder

Create the app service plan and web app if needed, then deploy the current folder.

az webapp up --name my-unique-app --resource-group my-rg --runtime "NODE:22-lts"

Stream web app logs

Follow the live log output of a web app.

az webapp log tail --name my-unique-app --resource-group my-rg

Set app settings

Set environment variables for a web app.

az webapp config appsettings set --name my-unique-app --resource-group my-rg --settings KEY=value

Create a storage account

Create a general-purpose storage account.

az storage account create --name mystorageacct123 --resource-group my-rg --sku Standard_LRS

Upload a blob

Upload a file to a container, authenticating with your sign-in.

az storage blob upload --account-name mystorageacct123 --container-name files --name data.csv --file data.csv --auth-mode login

List blobs

List the blobs in a container.

az storage blob list --account-name mystorageacct123 --container-name files --auth-mode login --output table

List SQL servers

List Azure SQL servers in a resource group.

az sql server list --resource-group my-rg --output table

Was this page helpful?