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
| Parameter | Type | Required | Description | 
|---|---|---|---|
| -Name | String | Yes | Name of the web app to stop. | 
| -ResourceGroupName | String | Yes | Resource group containing the web app. | 
| -Slot | String | No | Slot name if stopping a deployment slot. | 
| -Force | Switch | No | Suppresses confirmation prompts. | 
| -WhatIf | Switch | No | Shows what would happen if the cmdlet runs. | 
| -Confirm | Switch | No | Prompts 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