| author | AbhishekMallick-MS |
|---|---|
| ms.service | azure-backup |
| ms.custom | devx-track-azurepowershell |
| ms.topic | include |
| ms.date | 07/01/2024 |
| ms.author | v-abhmallick |
To restore from vaulted blob backup, run the following commands:
-
Fetch the backup instance for which you want to perform the restore.
$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e" -ResourceGroupName "StorageRG" -VaultName "contosobackupvault" -Name “abc” -
Fetch the recovery point you want to use for restoring the data.
$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e" -ResourceGroupName "StorageRG" -VaultName "contosobackupvault" -BackupInstanceName $instance.Name -
Use the Initialize-AzDataProtectionRestoreRequest command to prepare the restore request with all the relevant details. The target resource ID is the ARM ID of the alternate storage account where the contents should be restored.
$ResourceId="/subscriptions/xxxxxx /resourceGroups/StorageRG/providers/Microsoft.Storage/storageAccounts/xxxx " $restorerequest =Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore VaultStore -RestoreType AlternateLocation -BackupInstance $instance -RecoveryPoint $rp[0].Name -TargetResourceId $ResourceId -
To restore specific containers, pass the container list explicitly to the
-ContainersListparameter and also pass the parameter -ItemLevelRecovery.$restorerequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore VaultStore -RestoreType AlternateLocation -RecoveryPoint $rp[0].Name -TargetResourceId $ResourceId -ContainersList "test1" -RestoreLocation "eastus" -ItemLevelRecovery -
Trigger the restore with the restore request prepared in the above steps.
Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.Name -ResourceGroupName "StorageRG" -VaultName $TestBkpVault.Name -Parameter $restorerequest -
Restore specific blobs based on the prefix match in each container.
To restore specific blobs from vaulted backup, see this example.