Restore a recovery point

 

Use the restore action to restore a recovery point for a protected item. Use the Location header to track successful completion of the operation. Asynchronous operation completes as soon as the restore job is created. ARM resource ID of the restore job is returned as extended information in Azure-AsyncOperation resource. When restoring a recovery point for a VM, Azure checks the Linked Access for all resources used to create the VM. These are the resources that are checked.

  • SourceResourceId – Resource Manager Id of the original VM for which backup was configured. Verifiying in restore to ensure user has access to the source VM.
  • TargetResourceGroupId– Resource Manager Id of the Resource group to validate for write access.
  • VirtualMachineId – Resource Manager Id of the non-existing VM which is checked for write access.
  • StorageAccountId – Resource Manager Id of the storage account configured for copying backup data.
  • VirtualNetworkId – Resource Manager Id of the virtual network to check for join permissions.
  • SubNetId – Resource Manager Id of the subnet to check for join permissions.
  • TargetDomainId – Resource Manager Id of the Domain Name to be check for write permissions. Only used for V1 VMs.

Request

Trigger the restore action as follows.

Method Request URI HTTP Version
POST https://<VaultUrl>/backupFabrics/{fabricName}/backupProtectionContainers/{protectionContainerName}/backupProtectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName}/restore?api-version=<api-version> Http/1.1

Request Header:

Common request headers are described here.

Request Body:

{
  "properties": {
    "restoreRequestType": "AzureIaaSVMRestoreRequest",
    "recoveryType": "AlternateLocation",
    "createNewCloudService": "false",
    "sourceResourceId": "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.Compute/virtualMachine/{name}",
    "TargetResourceGroupId": "/subscriptions/{id}/resourceGroups/{rg}",
    "storageAccountId": "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{name}",
    "virtualNetworkId": "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.Network/virtualNetworks/{name}",
    "virtualMachineId":"/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.Compute/virtualMachine/{name}",
    "subnetId": "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.Network/virtualNetworks/{name}/subnets{subnetName}",
    "TargetDomainId": "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.ClassicCompute/domainNames/{name}",
    "location": "westus",
    "affinityGroup": "null",
    "diskEncryptionInfo": {
         "encryptionEnabled" : "true",
         "secretKeyURl" : "https://{keyvault-name}.vault.azure.net/{object-type}/{object-name}/{object-version} ",
         "SecretKeyVaultId" : "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.KeyVault/Vaults/{VaultId}",
         "KekUrl" : "https://{keyvault-name}.vault.azure.net/{object-type}/{object-name}/{object-version} ",
         "KekVaultId" : "/subscriptions/{id}/resourceGroups/{rg}/providers/Microsoft.KeyVault/Vaults/{VaultId}",
    }
  }
}
Element name Description
restoreRequestType Required: string
Type of the restore request, can have one of the following values: AzureIaaSVMRestoreRequest (to be extended further database restore request, etc).
recoveryType Required: string
Type of the recovery, can have one of the following values: OriginalLocation, AlternateLocation, RestoreDisks
storageAccount Required: true
ARM ID of the storage account where the disks have to be recreated.
virtualMachineName Optional: string
Virtual machine name
createNewCloudService Optional: bool
Create the cloud service or resource group if it does not exist.
virtualNetworkId Optional: string
Resource Manager Id of the cloud service or resource group of the VM to be created.
Location Optional: string
Location where the VM should be restored.
AffinityGroup Optional: string
Affinity group of the VM
virtualMachineId Optional: string
Resource Manager Id of the virtual machine that will be created.
sourceResourceId Mandatory string
Resource Manager Id of the original VM that is going to be restored.

Response

The response includes an HTTP status code of 202 if the operation is successfully submitted.

Response Header:

Common response headers are described here.

Response Body:

None