Restore-AzureRmBackupItem

Restores the data and configuration for a Backup item to a recovery point.

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

Restore-AzureRmBackupItem
       [-StorageAccountName] <String>
       [-RecoveryPoint] <AzureRMBackupRecoveryPoint>
       [-DefaultProfile <IAzureContextContainer>]
       [<CommonParameters>]

Description

The Restore-AzureRmBackupItem cmdlet restores the data and configuration for an Azure Backup item to a specified recovery point. This cmdlet starts the restore from the Backup vault to your account. The restore operation does not restore the full virtual machine. It restores the disk data and configuration information. After the restore operation finished, you must create the virtual machine and start it.

Examples

Example 1: Restore a virtual machine to a recovery point

PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> $Container = Get-AzureRmBackupContainer -Vault $Vault -Type AzureVM -Name "DPMSERVER.CONTOSO.COM"
PS C:\> $BackupItem = Get-AzureRmBackupItem -Container $Container
PS C:\> $RecoveryPoint = Get-AzureRmBackupRecoveryPoint -Item $BackupItem 
PS C:\> Restore-AzureRmBackupItem -StorageAccountName "DestinationAccount" -RecoveryPoint $RecoveryPoint 
WorkloadName    Operation       Status          StartTime              EndTime
------------    ---------       ------          ---------              -------
co03-vm         Restore         InProgress      26-Aug-15 1:14:01 PM   01-Jan-01 12:00:00 AM

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 container that has the specified name in the vault in $Vault by using the Get-AzureRmBackupContainer cmdlet. The command stores that object in the $Container variable. The third command gets the backup item in the container in $Container by using the Get-AzureRmBackupItem cmdlet. The command stores that object in the $BackupItem variable. The fourth command gets recovery point for the item in $BackupItem. The command stores that object in the $RecoveryPoint variable. The final command restores the recovery point in $RecoveryPoint for the account named DestinationAccount.

Parameters

-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

-RecoveryPoint

Specifies the recovery point to which to restore the virtual machine. To obtain an AzureRmBackupRecoveryPoint, use the Get-AzureRmBackupRecoveryPoint cmdlet.

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

-StorageAccountName

Specifies the name of the target storage account in your subscription. As a part of the restore process, this cmdlet stores the disks and the configuration information in this storage account.

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

Inputs

AzureRMBackupRecoveryPoint

Parameters: RecoveryPoint (ByValue)

Outputs

AzureRMBackupJob