Azure PowerShell Documentation

Stop-AzWebApp

The Stop-AzWebApp cmdlet stops a web app (or a web app slot) in Azure App Service. Stopping a web app releases its resources but retains its configuration.

Syntax

Stop-AzWebApp [-Name] <String> [-ResourceGroupName] <String> [-Slot] <String> [-Force] [-WhatIf] [-Confirm] []

Parameters

ParameterTypeRequiredDescription
-NameStringYesName of the web app to stop.
-ResourceGroupNameStringYesResource group containing the web app.
-SlotStringNoSlot name if stopping a deployment slot.
-ForceSwitchNoSuppresses confirmation prompts.
-WhatIfSwitchNoShows what would happen if the cmdlet runs.
-ConfirmSwitchNoPrompts for confirmation before executing.

Examples

Example 1: Stop a web app

# Stop the web app named “myWebApp” in resource group “myRG”
Stop-AzWebApp -Name "myWebApp" -ResourceGroupName "myRG"

Example 2: Stop a deployment slot without confirmation

# Stop the staging slot of the web app
Stop-AzWebApp -Name "myWebApp" -ResourceGroupName "myRG" -Slot "staging" -Force

Related Cmdlets