Microsoft

Azure App Service PowerShell Reference – Overview

The Azure App Service PowerShell module provides cmdlets to manage web apps, functions, and mobile back‑ends. Use these cmdlets to create, configure, and monitor App Service resources directly from the command line or scripts.

Getting Started

Install the module from the PowerShell Gallery and import it into your session.

Install-Module -Name Az.AppService -Repository PSGallery -Force
Import-Module Az.AppService

Cmdlet Overview

Cmdlet Description Link
Get-AzWebApp Retrieves details of a web app. Docs
New-AzWebApp Creates a new web app. Docs
Set-AzWebApp Updates configuration of an existing web app. Docs
Remove-AzWebApp Deletes a web app. Docs
Get-AzWebAppSlot Gets deployment slot information. Docs
New-AzWebAppSlot Creates a new deployment slot. Docs

Sample Script: Deploy a Web App

# Variables
$resourceGroup = "MyResourceGroup"
$planName      = "MyAppServicePlan"
$appName       = "mywebapp$(Get-Random)"
$location      = "EastUS"

# Create App Service Plan
New-AzAppServicePlan -Name $planName -ResourceGroupName $resourceGroup -Location $location -Tier "Standard"

# Create Web App
New-AzWebApp -Name $appName -ResourceGroupName $resourceGroup -Location $location -AppServicePlan $planName

# Output URL
$webApp = Get-AzWebApp -Name $appName -ResourceGroupName $resourceGroup
Write-Host "Web app URL:" $webApp.DefaultHostName

Additional Resources