Get-AzRecoveryServicesBackupWorkloadRecoveryConfig

This command constructs the recovery configuration of a backed up item such as SQL DB. The configuration object stores all details such as the recovery mode, target destinations for the restore and application specific parameters like target physical paths for SQL.

Syntax

Get-AzRecoveryServicesBackupWorkloadRecoveryConfig
   [[-RecoveryPoint] <RecoveryPointBase>]
   [[-TargetItem] <ProtectableItemBase>]
   [[-Item] <ItemBase>]
   [-OriginalWorkloadRestore]
   [-AlternateWorkloadRestore]
   [-TargetContainer <ContainerBase>]
   [-RestoreAsFiles]
   [-FromFull <RecoveryPointBase>]
   [-FilePath <String>]
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-UseSecondaryRegion]
   [<CommonParameters>]
Get-AzRecoveryServicesBackupWorkloadRecoveryConfig
   [[-PointInTime] <DateTime>]
   [[-TargetItem] <ProtectableItemBase>]
   [[-Item] <ItemBase>]
   [-OriginalWorkloadRestore]
   [-AlternateWorkloadRestore]
   [-TargetContainer <ContainerBase>]
   [-RestoreAsFiles]
   [-FromFull <RecoveryPointBase>]
   [-FilePath <String>]
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-UseSecondaryRegion]
   [<CommonParameters>]

Description

The command returns a recovery config for AzureWorkload items which is passed to the restore cmdlet.

Examples

Example 1

$SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesBackupWorkloadRecoveryConfig -OriginalWorkloadRestore
$SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesBackupWorkloadRecoveryConfig -AlternateWorkloadRestore -TargetItem $SQLProtItem -TargetContainer $targetVMContainer

The first cmdlet is used to get the Recovery point object. The second cmdlet creates a recovery plan for a original location restore. THe third cmdlet creates a recovery plan for a alternate location restore. Note: Parameter -TargetContainer is mandatory in case of AlternateLocationRestore or RestoreAsFiles.

Example 2

This command constructs the recovery configuration of a backed up item such as SQL DB. (autogenerated)

Get-AzRecoveryServicesBackupWorkloadRecoveryConfig -AlternateWorkloadRestore -RecoveryPoint $rp[0] -TargetItem <ProtectableItemBase> -TargetContainer $targetVMContainer -VaultId $vault.ID

Parameters

-AlternateWorkloadRestore

Specifies that the backed up DB should be restored onto another selected server.

Type:SwitchParameter
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:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FilePath

Specifies the filepath which is used for restore operation.

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

-FromFull

Specifies the Full RecoveryPoint to which Log backups will be applied.

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

-Item

Specifies the backup item on which the restore operation is being performed.

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

-OriginalWorkloadRestore

Specifies that the backed up DB is to be overwritten with the DB information present in the recovery point.

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

-PointInTime

End time of Time range for which recovery point need to be fetched

Type:DateTime
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryPoint

Recovery point object to be restored

Type:RecoveryPointBase
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RestoreAsFiles

Specifies to restore Database as files in a machine.

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

-TargetContainer

Specifies the target machine on which DB Files need to be restored. TargetContainer is mandatory in case of AlternateLocationRestore or RestoreAsFiles.

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

-TargetItem

Specifies the target on which the DB needs to be restored. For SQL restores, it needs to be of protectable item type SQLInstance only.

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

-UseSecondaryRegion

Filters from Secondary Region for Cross Region Restore

Type:SwitchParameter
Position:Named
Default value:None
Required:False
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

Inputs

RecoveryPointBase

System.String

Outputs

RecoveryConfigBase