Stop-AzureResourceGroupDeployment
Stop-AzureResourceGroupDeployment
Cancels a resource group deployment.
Syntax
Parameter Set: Default
Stop-AzureResourceGroupDeployment [-ResourceGroupName] <String> [[-Name] <String> ] [[-Force]] [[-PassThru]] [-Profile <AzureProfile> ] [ <CommonParameters>]
Detailed Description
The Stop-AzureResourceGroupDeployment cmdlet cancels an Azure resource group deployment that is started, but not finished. You can stop a deployment that has an incomplete provisioning state, such as Provisioning. You cannot stop a job that has a completed state, such as Provisioned or Failed. By default, this cmdlet prompts you for confirmation. For more information about deployment for resource groups, see the New-AzureResourceGroupDeployment cmdlet.
The New-AzureResource cmdlet creates a resource, but it does not trigger a resource group deployment operation that this cmdlet can stop. For more information about Azure resources and Azure resource groups, see the New-AzureResourceGroup cmdlet.
This cmdlet stops only one running deployment. Specify the Name parameter for this cmdlet to stop a particular deployment. If you do not specify a name, checks for running deployments. If the cmdlet finds one running deployment, it stops that deployment. If the cmdlet finds more than one running deployment, it does nothing.
Parameters
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the resource group deployment that this cmdlet stops.
Aliases |
DeploymentName |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-PassThru
Indicates that this cmdlet returns $True if the cancel operation succeeds, or $False if it fails. By default, this cmdlet returns no output.
Aliases |
none |
Required? |
false |
Position? |
4 |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Profile<AzureProfile>
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ResourceGroupName<String>
Specifies the name of the resource group that is associated with the deployment.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None
You can pipe input to the cmdlet by property name, but not by value.
Outputs
The output type is the type of the objects that the cmdlet emits.
Boolean
This cmdlet returns a Boolean value, if you specify the PassThru parameter.
Examples
Example 1: Stop a resource group deployment
The first command creates and deploys a resource group named ContosoRG01 by using the New-AzureResourceGroup cmdlet.
The second command stops the deployment for the resource group named ContosoRG01 before it finishes. The command specifies the Force parameter. Therefore, it does not prompt you for confirmation.
New-AzureResourceGroup -ResourceGroupName "ContosoRG01" -GalleryTemplateName "WebHosting" -TemplateParameterFile ".\HostingTemplateValues"
PS C:\> Stop-AzureResourceGroupDeployment -ResourceGroupName "ContosoRG01" -Force
Example 2: Stop a resource group deployment by specifying a deployment name
This command stops the deployment named DeployPortal before it finishes. Because the command includes the PassThru parameter, it returns a value of $True to indicate that the deployment stopped.
Stop-AzureResourceGroupDeployment -ResourceGroupName "ContosoRG01" -Name "DeployPortal" -PassThru
Related topics
Get-AzureResourceGroupDeployment