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]
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzRecoveryServicesBackupWorkloadRecoveryConfig
   [[-PointInTime] <DateTime>]
   [[-TargetItem] <ProtectableItemBase>]
   [[-Item] <ItemBase>]
   [-OriginalWorkloadRestore]
   [-AlternateWorkloadRestore]
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

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

Examples

Example 1

PS C:\> $SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesWorkloadRecoveryConfig -OriginalWorkloadRestore
PS C:\> $SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesWorkloadRecoveryConfig -AlternateWorkloadRestore -TargetItem $SQLProtItem

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 crreats a recovery plan for a alternate location restore.

Parameters

-AlternateWorkloadRestore

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
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

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

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Item

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

Type:Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ItemBase
Position:2
Default value:None
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
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
Accept pipeline input:False
Accept wildcard characters:False
-RecoveryPoint

Recovery point object to be restored

Type:Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.RecoveryPointBase
Position:0
Default value:None
Accept pipeline input:True (ByValue)
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:Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ProtectableItemBase
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.RecoveryPointBase

System.String

Outputs

Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.RecoveryConfigBase

Notes