Stop-AzureRmRecoveryServicesBackupJob

Cancels a running job.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Stop-AzureRmRecoveryServicesBackupJob
    [-Job] <JobBase>
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Stop-AzureRmRecoveryServicesBackupJob
    [-JobId] <String>
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Stop-AzureRmRecoveryServicesBackupJob cmdlet cancels an existing Azure Backup job. Use this cmdlet to stop a job that takes too long and blocks other activities. You can cancel only Backup and Restore job types. Set the vault context by using the Set-AzureRmRecoveryServicesVaultContext cmdlet before you use the current cmdlet.

Examples

Example 1: Stop a backup job

PS C:\>$Job = Get-AzureRmRecoveryServicesBackupJob -Operation Backup
PS C:\> Stop-AzureRmRecoveryServicesBackupJob -JobID $Job.InstanceId

The first command gets a backup job, and then stores the job in the $Job variable. The last command stops the job by specifying the Instance ID of the backup job in $Job.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Job

Specifies a job that this cmdlet cancels. To obtain a BackupJob object, use the Get-AzureRmRecoveryServicesBackupJob cmdlet.

Type:JobBase
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-JobId

Specifies the ID of the job to cancel. The ID is the InstanceId property of a BackupJob object. To obtain an BackupJob object, use Get-AzureRmRecoveryServicesBackupJob.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Parameters: VaultId (ByValue)

Outputs

JobBase