Stops a running deployment of a resource group.

SYNTAX

Stop-AzResourceGroupDeployment -Name <String> -ResourceGroupName <String> [-Force] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Stop-AzResourceGroupDeployment cmdlet stops a deployment of a resource group that is currently running.

To stop a deployment, you must specify its name and the name of the resource group to which it belongs.

If the deployment is not running, this cmdlet has no effect.

PARAMETERS

Name Type Description Required?
-Name String The name of the deployment to stop. Yes
-ResourceGroupName String The name of the resource group that contains the deployment. Yes
-Force SwitchParameter Suppresses the confirmation prompt. No
-AsJob SwitchParameter Run cmdlet in the background. No
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run. No
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet. No

EXAMPLES

# Stop a deployment named 'myDeployment' in the resource group 'myResourceGroup' Stop-AzResourceGroupDeployment -Name "myDeployment" -ResourceGroupName "myResourceGroup"

# Stop a deployment without confirmation prompt Stop-AzResourceGroupDeployment -Name "anotherDeployment" -ResourceGroupName "myResourceGroup" -Force

INPUTS

None. You can pipe to this cmdlet.

OUTPUTS

None.

NOTES

Important: This cmdlet can only stop deployments that are in a 'Running' state. Deployments that have already completed, failed, or been canceled cannot be stopped.

This cmdlet uses the Stop operation for Azure Resource Manager deployments. Ensure you have the necessary permissions to perform this action.