Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Stop-AzureResourceGroupDeployment

Stop-AzureResourceGroupDeployment

microsoft.azure.commands.resources.dll

Synopsis

Cancels a resource group deployment

Syntax

Stop-AzureResourceGroupDeployment [-ResourceGroupName] [-Name] [-Force] [-PassThru] [<CommonParameters>]

Detailed Description

The Stop-AzureResourceGroupDeployment cmdlet cancels an Azure resource group deployment that is started, but not completed. To stop a deployment, the deployment must have an incomplete provisioning state, such as Provisioning, and not a completed state, such as Provisioned or Failed.An Azure resource is a user-managed entity, such as a website, database, or database server. A resource group is a collection of resources that are deployed as a unit. To deploy a resource group, use the New-AzureResourceGroup or New-AzureResourceGroupDeployment cmdlets. The New-AzureResource cmdlet creates a new resource, but it does not trigger a resource group deployment operation that this cmdlet can stop.This cmdlet stops only one running deployment. Use the Name parameter to stop a particular deployment. If you omit the Name parameter, Stop-AzureResourceGroupDeployment searches for a running deployment and stops it, but if it finds more than one running deployment, the command fails.By default, Stop-AzureResourceGroupDeployment prompts you for confirmation. To suppress the prompt, use the Force parameter.

Parameters

-ResourceGroupName <String>

Stops the deployment of the specified resource group. This parameter is required.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Name <String>

Stops the specified deployment. Enter the deployment name. This parameter is optional.Without this parameter, Stop-AzureResourceGroupDeployment searches for a running deployment in the resource group and stops it, but if it finds more than one running deployment, the command fails.You can use -Name or its alias, -DeploymentName.To find the deployment name, use the Get-AzureResourceGroupDeployment cmdlet.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Force <SwitchParameter>

Suppresses the confirmation prompt. By default, Stop-AzureResourceGroupDeployment prompts you before stopping a deployment.

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-PassThru <SwitchParameter>

Returns $True when the stopping operation succeeds and $False when it fails. By default, this cmdlet does not generate any output.

Aliases

None

Required?

false

Position

3

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type

None

Return Type

None or Boolean

Notes

The Stop-AzureResourceGroupDeployment cmdlet is included in the Azure Resource Manager module beginning in module version 0.8.0.

Examples

-------------------------- Example 1: Stop a resource group deployment --------------------------

This example shows how to use the Stop-AzureResourceGroupDeployment command to stop a deployment in progress. The first command uses the New-AzureResourceGroup cmdlet to create and deploy a new resource group.

PS C:\>New-AzureResourceGroup -ResourceGroupName ContosoRG01 -GalleryTemplateName WebHosting -TemplateParameterFile .\HostingTemplateValues
 
PS C:\>Stop-AzureResourceGroupDeployment -ResourceGroupName ContosoRG01 -Force

-------------------------- Example 2: Stop a resource group deployment by deployment name --------------------------

This example shows how to use the Name (alias DeploymentName) parameter of the Stop-AzureResourceGroupDeployment command to stop a deployment in progress.

PS C:\>New-AzureResourceGroup -ResourceGroupName ContosoRG01 -GalleryTemplateName WebHosting -TemplateParameterFile .\HostingTemplateValues -DeploymentName DeployHost
 
PS C:\>New-AzureResourceGroupDeployment -ResourceGroupName ContosoRG01 -TemplateParameterFile .\PortalTemplateValues -GalleryTemplateName WebPortal -DeploymentName DeployPortal

PS C:\>Stop-AzureResourceGroupDeployment -ResourceGroupName ContosoRG01 -Name DeployPortal -Passthru
True

Online Version