Stop-​Azure​Rm​Backup​Job

Cancels an existing Backup job.

Syntax

Stop-AzureRmBackupJob
    -Job <AzureRMBackupJob>
    [<CommonParameters>]
Stop-AzureRmBackupJob
    -JobID <String>
    -Vault <AzureRMBackupVault>
    [<CommonParameters>]

Description

The Stop-AzureRmBackupJob cmdlet cancels an existing Azure Backup job. Use this parameter to stop a job that takes too long and blocks other activities.

You can cancel only the following types of jobs:

- Backup

  • Restore

Examples

Example 1: Stop a backup job by using a job ID

PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03" 
PS C:\> $Job = Get-AzureRmBackupJob -Vault $Vault -Operation Backup
PS C:\> Stop-AzureRmBackupJob -Vault $Vault -JobID $Job.InstanceId

The first command gets the vault named Vault03 by using the Get-AzureRmBackupVault cmdlet. The command stores that object in the $Vault variable.

The second command gets a backup job from the vault in $Vault by using the Get-AzureRmBackupJob cmdlet. The command stores the job in the $Job variable. In this example, there is only one backup operation in the specified vault.

The final command stops the job that has the specified ID.

Example 2: Stop all Restore operations

PS C:\>Get-AzureRmBackupJob -Vault $Vault -Operation Restore | Stop-AzureRmBackupJob

This command gets all the restore operations in the vault in $Vault, and then passes them to the current cmdlet by using the pipeline operator. The current cmdlet stops each job.

Required Parameters

-Job

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

Type:AzureRMBackupJob
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-JobID

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Vault

Specifies the Backup vault in which this cmdlet cancels a job. To obtain an AzureRmBackupVault object, use the Get-AzureRmBackupVault cmdlet.

Type:AzureRMBackupVault
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureRmBackupJob

Outputs

None