Stop-AzSubDeployment
Cancel a currently running subscription-scope deployment.
Syntax
StopByDeploymentName (Default)
Stop-AzSubDeployment
[-Name] <string>
[-SubscriptionId <string>]
[-PassThru]
[-Profile <string>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
StopByInputObject
Stop-AzSubDeployment
-InputObject <DeploymentExtended>
[-PassThru]
[-Profile <string>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Aliases
This cmdlet has the following aliases, Stop-AzSubscriptionDeployment
Description
Cancels a running Azure Resource Manager deployment scoped to a subscription. A deployment can only be cancelled while its provisioning state is Accepted or Running; once cancelled the state becomes Canceled, and any resources the deployment already created remain. Cancelling a deployment that has already reached a terminal state fails. Identify the deployment by -Name, or by piping a deployment object from Get-AzSubDeployment. The cmdlet emits nothing on success unless -PassThru is specified.
Examples
Cancel a running deployment
Stop the in-flight deployment named sub-infra-2026-06-18.
Stop-AzSubDeployment -Name sub-infra-2026-06-18
Cancel a deployment in a specific subscription without being prompted
Stop-AzSubDeployment -Name sub-infra-2026-06-18 -SubscriptionId 00000000-0000-0000-0000-000000000000 -Confirm:$false
Cancel a deployment from the pipeline
Get-AzSubDeployment -Name sub-infra-2026-06-18 | Stop-AzSubDeployment -PassThru
-PassThru writes True once the cancellation succeeds.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-InputObject
A deployment object returned by Get-AzSubDeployment.
Its Id identifies the subscription and deployment to cancel. Accepts pipeline input.
Parameter properties
| Type: | Microsoft.Azure.Azclips.Extensions.Resources.Models.DeploymentExtended |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
StopByInputObject
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Name
The name of the deployment to cancel.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | DeploymentName |
Parameter sets
StopByDeploymentName
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-PassThru
Writes true after the cancellation call returns without a terminating error.
No value is written when -WhatIf or a declined confirmation skips cancellation.
Parameter properties
| Type: | SwitchParameter |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Profile
Name of a saved profile to use for this call instead of the currently-active one. Manage profiles with Set-AzProfile / Get-AzProfile.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SubscriptionId
The Azure subscription that owns the deployment. Defaults to the active profile's subscription when omitted.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
StopByDeploymentName
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Parameter properties
| Type: | SwitchParameter |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Microsoft.Azure.Azclips.Extensions.Resources.Models.DeploymentExtended
Accepts a subscription deployment object from the pipeline, for example the output of Get-AzSubDeployment.
Outputs
Boolean
No output by default. With -PassThru, writes true after the cancellation call returns.
Failures surface as terminating errors.
Notes
Cancelling does not roll back resources the deployment already created. Use Get-AzSubDeployment to confirm the deployment reached the Canceled state. The legacy Az.Resources name Stop-AzSubscriptionDeployment is accepted as an alias.