az backup restore

Restore backed up items from recovery points in a Recovery Services vault.

Commands

az backup restore files

Gives access to all files of a recovery point.

az backup restore files mount-rp

Download a script which mounts files of a recovery point.

az backup restore files unmount-rp

Close access to the recovery point.

az backup restore restore-azurefiles

Restore backed up Azure files within a file-share to the same file-share or another file-share in registered storage accounts.

az backup restore restore-azurefileshare

Restore backed up Azure file shares to the same file-share or another file-share in registered storage accounts.

az backup restore restore-azurewl

Restore backed up Azure Workloads in a Recovery services vault to another registered container or to the same container.

az backup restore restore-disks

Restore disks of the backed VM from the specified recovery point.

az backup restore restore-azurefiles

Restore backed up Azure files within a file-share to the same file-share or another file-share in registered storage accounts.

az backup restore restore-azurefiles --resolve-conflict {Overwrite, Skip}
                                     --restore-mode {AlternateLocation, OriginalLocation}
                                     [--container-name]
                                     [--ids]
                                     [--item-name]
                                     [--resource-group]
                                     [--rp-name]
                                     [--source-file-path]
                                     [--source-file-type {Directory, File}]
                                     [--target-file-share]
                                     [--target-folder]
                                     [--target-storage-account]
                                     [--vault-name]

Examples

Restore backed up Azure files within a file-share to the same file-share or another file-share in registered storage accounts.

az backup restore restore-azurefiles --resource-group MyResourceGroup --vault-name MyVault --container-name MyContainer --item-name MyItem --rp-name recoverypoint --resolve-conflict Overwrite --restore-mode OriginalLocation --source-file-type File --source-file-path Filepath1 Filepath2

Required Parameters

--resolve-conflict

Instruction if there's a conflict with the restored data.

accepted values: Overwrite, Skip
--restore-mode

Specify the restore mode.

accepted values: AlternateLocation, OriginalLocation

Optional Parameters

--container-name -c

Name of the backup container. Accepts 'Name' or 'FriendlyName' from the output of az backup container list command. If 'FriendlyName' is passed then BackupManagementType is required.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--item-name -i

Name of the backed up item.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--rp-name -r

Name of the recovery point.

--source-file-path

The absolute path of the file, to be restored within the file share, as a string. This path is the same path used in the 'az storage file download' or 'az storage file show' CLI commands.

--source-file-type

Specify the source file type to be selected.

accepted values: Directory, File
--target-file-share

Destination file share to which content will be restored.

--target-folder

Destination folder to which content will be restored. To restore content to root , leave the folder name empty.

--target-storage-account

Destination storage account to which content will be restored.

--vault-name -v

Name of the Recovery services vault.

az backup restore restore-azurefileshare

Restore backed up Azure file shares to the same file-share or another file-share in registered storage accounts.

az backup restore restore-azurefileshare --resolve-conflict {Overwrite, Skip}
                                         --restore-mode {AlternateLocation, OriginalLocation}
                                         [--container-name]
                                         [--ids]
                                         [--item-name]
                                         [--resource-group]
                                         [--rp-name]
                                         [--target-file-share]
                                         [--target-folder]
                                         [--target-storage-account]
                                         [--vault-name]

Examples

Restore backed up Azure file shares to the same file-share or another file-share in registered storage accounts.

az backup restore restore-azurefileshare --resource-group MyResourceGroup --vault-name MyVault --container-name MyContainer --item-name MyItem --rp-name recoverypoint --resolve-conflict Overwrite --restore-mode OriginalLocation

Required Parameters

--resolve-conflict

Instruction if there's a conflict with the restored data.

accepted values: Overwrite, Skip
--restore-mode

Specify the restore mode.

accepted values: AlternateLocation, OriginalLocation

Optional Parameters

--container-name -c

Name of the backup container. Accepts 'Name' or 'FriendlyName' from the output of az backup container list command. If 'FriendlyName' is passed then BackupManagementType is required.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--item-name -i

Name of the backed up item.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--rp-name -r

Name of the recovery point.

--target-file-share

Destination file share to which content will be restored.

--target-folder

Destination folder to which content will be restored. To restore content to root , leave the folder name empty.

--target-storage-account

Destination storage account to which content will be restored.

--vault-name -v

Name of the Recovery services vault.

az backup restore restore-azurewl

Restore backed up Azure Workloads in a Recovery services vault to another registered container or to the same container.

az backup restore restore-azurewl --recovery-config
                                  --resource-group
                                  --vault-name
                                  [--rehydration-duration]
                                  [--rehydration-priority {High, Standard}]
                                  [--use-secondary-region]

Examples

Restore backed up Azure Workloads in a Recovery services vault to another registered container or to the same container.

az backup restore restore-azurewl --resource-group MyResourceGroup --vault-name MyVault --recovery-config MyRecoveryConfig

Required Parameters

--recovery-config

Specify the recovery configuration of a backed up item. The configuration object can be obtained from 'backup recoveryconfig show' command.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--vault-name -v

Name of the Recovery services vault.

Optional Parameters

--rehydration-duration

Set the maximum time, in days (between 10-30, both inclusive) for which the recovery point stays in hydrated state.

default value: 15
--rehydration-priority

The type of priority to be maintained while rehydrating a recovery point.

accepted values: High, Standard
--use-secondary-region

Use this flag to restore from a recoverypoint in secondary region.

az backup restore restore-disks

Restore disks of the backed VM from the specified recovery point.

az backup restore restore-disks --storage-account
                                [--container-name]
                                [--disk-encryption-set-id]
                                [--diskslist]
                                [--ids]
                                [--item-name]
                                [--mi-system-assigned]
                                [--mi-user-assigned]
                                [--rehydration-duration]
                                [--rehydration-priority {High, Standard}]
                                [--resource-group]
                                [--restore-as-unmanaged-disks {false, true}]
                                [--restore-mode {AlternateLocation, OriginalLocation}]
                                [--restore-only-osdisk {false, true}]
                                [--restore-to-staging-storage-account {false, true}]
                                [--rp-name]
                                [--target-resource-group]
                                [--target-subnet-name]
                                [--target-subscription-id]
                                [--target-vm-name]
                                [--target-vnet-name]
                                [--target-vnet-resource-group]
                                [--target-zone {1, 2, 3}]
                                [--use-secondary-region]
                                [--vault-name]

Examples

Restore disks of the backed VM from the specified recovery point. (autogenerated)

az backup restore restore-disks --container-name MyContainer --item-name MyItem --resource-group MyResourceGroup --rp-name MyRp --storage-account mystorageaccount --vault-name MyVault

Required Parameters

--storage-account

Name or ID of the staging storage account. The VM configuration will be restored to this storage account. See the help for --restore-to-staging-storage-account parameter for more info.

Optional Parameters

--container-name -c

Name of the backup container. Accepts 'Name' or 'FriendlyName' from the output of az backup container list command. If 'FriendlyName' is passed then BackupManagementType is required.

--disk-encryption-set-id

The disk encryption set id is used for encrypting restored disks. Please ensure access to disk encryption set id that is specified here.

--diskslist

List of disks to be excluded or included.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--item-name -i

Name of the backed up item.

--mi-system-assigned

Use this flag to specify whether a system-assigned managed identity should be used for the restore operation. MI option is not applicable for restoring unmanaged disks.

--mi-user-assigned

ARM ID of the user-assigned managed identity to use for the restore operation. Specify a value for this parameter if you do not want to use a system-assigned MI for restoring the backup item.

--rehydration-duration

Set the maximum time, in days (between 10-30, both inclusive) for which the recovery point stays in hydrated state.

default value: 15
--rehydration-priority

The type of priority to be maintained while rehydrating a recovery point.

accepted values: High, Standard
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--restore-as-unmanaged-disks

Use this flag to specify to restore as unmanaged disks.

accepted values: false, true
--restore-mode

Specify the restore mode.

accepted values: AlternateLocation, OriginalLocation
default value: AlternateLocation
--restore-only-osdisk

Use this flag to restore only OS disks of a backed up VM.

accepted values: false, true
--restore-to-staging-storage-account

Use this flag when you want disks to be restored to the staging storage account using the --storage-account parameter. When not specified, disks will be restored to their original storage accounts. Default: false.

accepted values: false, true
--rp-name -r

Name of the recovery point.

--target-resource-group -t

Use this to specify the target resource group in which the restored disks will be saved.

--target-subnet-name

Name of the subnet in which the target VM should be created, in the case of Alternate Location restore a new VM.

--target-subscription-id

ID of the subscription to which the resource should be restored.

--target-vm-name

Name of the VM to which the data should be restored, in the case of Alternate Location restore to a new VM.

--target-vnet-name

Name of the VNet in which the target VM should be created, in the case of Alternate Location restore to a new VM.

--target-vnet-resource-group

Name of the resource group which contains the target VNet, in the case of Alternate Location restore to a new VM.

--target-zone

A primary region currently can have three Azure availability zones. Use this argument to specify the target zone number while doing Cross Zonal Restore.

accepted values: 1, 2, 3
--use-secondary-region

Use this flag to restore from a recoverypoint in secondary region.

--vault-name -v

Name of the Recovery services vault.