LinuxCommandLibrary

az-webapp

Manage Azure App Service web apps

TLDR

List available runtimes for a web application

$ az webapp list-runtimes [[-os|--os-type]] [windows|linux]
copy

Create a web application
$ az webapp up [[-n|--name]] [name] [[-l|--location]] [location] [[-r|--runtime]] [runtime]
copy

List all web applications
$ az webapp list
copy

Delete a specific web application
$ az webapp delete [[-n|--name]] [name] [[-g|--resource-group]] [resource_group]
copy

SYNOPSIS

az webapp [<SUBCOMMAND>] [--debug] [--help -h] [--only-show-errors] [--output -o {json,jsonc,table,tsv,yaml}] [--query JMESPath] [--subscription] [--verbose]

PARAMETERS

--debug
    Increase logging verbosity to show all debug logs.

--help -h
    Show this help message and exit.

--only-show-errors
    Only show errors, suppressing warnings.

--output -o
    Output format.
Allowed: json, jsonc, table, tsv, yaml.

--query
    JMESPath query string. Empty string returns nothing.

--subscription
    Name or ID of subscription. Use az account set to set default.

--verbose
    Increase logging verbosity (use --debug for full logs).

DESCRIPTION

az webapp is a core command group in the Azure Command-Line Interface (CLI) for creating, deploying, configuring, and managing web applications on Azure App Service. Azure Web Apps provide a PaaS platform supporting languages like .NET, Java, Node.js, PHP, Python, and Ruby, with built-in CI/CD, auto-scaling, and high availability.

Key capabilities include rapid setup and deployment with az webapp up (detects settings and pushes code), detailed creation via az webapp create, runtime configuration with az webapp config (appsettings, connection strings, slots), deployment slots for zero-downtime updates, log streaming (az webapp log tail), and hybrid connections. It supports containerized apps via Docker and custom handlers.

Designed for automation, it excels in scripts, GitHub Actions, and pipelines, with JSON output for parsing. Requires Azure CLI v2.0+ and az login authentication. Cross-platform on Linux, macOS, Windows.

CAVEATS

Requires Azure CLI 2.0+, az login authentication, and appropriate RBAC permissions. Many subcommands need --resource-group and --name. Preview features marked as such may change.

KEY SUBCOMMANDS

up: Quick create/deploy.
create: Create web app.
deploy: Deploy zip/Git/Docker.
config: Manage settings/slots.
log tail: Stream logs.
list/show: List/view apps.

PREREQUISITES

Install via curl -sL https://aka.ms/InstallAzureCLIDeb | bash. Authenticate with az login. Set default location like --location westus.

HISTORY

Introduced in Azure CLI 2.0 (2017-2018) alongside App Service evolution. az webapp up added ~2019 for simplified deployments. Regularly updated for Linux containers, managed identities, and multi-region support.

SEE ALSO

az(1), az-functionapp(1)

Copied to clipboard