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 --container-name
                                     --item-name
                                     --resolve-conflict {Overwrite, Skip}
                                     --restore-mode {AlternateLocation, OriginalLocation}
                                     --rp-name
                                     [--ids]
                                     [--resource-group]
                                     [--source-file-path]
                                     [--source-file-type {Directory, File}]
                                     [--subscription]
                                     [--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

--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.

--item-name -i

Name of the backed up item.

--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
--rp-name -r

Name of the recovery point.

Optional Parameters

--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.

--resource-group -g

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

--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
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--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 --container-name
                                         --item-name
                                         --resolve-conflict {Overwrite, Skip}
                                         --restore-mode {AlternateLocation, OriginalLocation}
                                         --rp-name
                                         [--ids]
                                         [--resource-group]
                                         [--subscription]
                                         [--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

--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.

--item-name -i

Name of the backed up item.

--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
--rp-name -r

Name of the recovery point.

Optional Parameters

--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.

--resource-group -g

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--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
                                  [--ids]
                                  [--resource-group]
                                  [--subscription]
                                  [--vault-name]

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.

Optional Parameters

--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.

--resource-group -g

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--vault-name -v

Name of the Recovery services vault.

az backup restore restore-disks

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

az backup restore restore-disks --container-name
                                --item-name
                                --rp-name
                                --storage-account
                                [--diskslist]
                                [--ids]
                                [--resource-group]
                                [--restore-as-unmanaged-disks {false, true}]
                                [--restore-only-osdisk {false, true}]
                                [--restore-to-staging-storage-account {false, true}]
                                [--subscription]
                                [--target-resource-group]
                                [--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

--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.

--item-name -i

Name of the backed up item.

--rp-name -r

Name of the recovery point.

--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

--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.

--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-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
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--target-resource-group -t

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

--vault-name -v

Name of the Recovery services vault.