Share via


az backup restore

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

Commands

Name Description Type Status
az backup restore files

Gives access to all files of a recovery point.

Core GA
az backup restore files mount-rp

Download a script which mounts files of a recovery point.

Core GA
az backup restore files unmount-rp

Close access to the recovery point.

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

Core GA
az backup restore restore-azurefileshare

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

Core GA
az backup restore restore-azurewl

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

Core GA
az backup restore restore-disks

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

Core GA

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}]
                                     [--subscription]
                                     [--target-file-share]
                                     [--target-folder]
                                     [--target-storage-account]
                                     [--tenant-id]
                                     [--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
--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.

--tenant-id

ID of the tenant if the Resource Guard protecting the vault exists in a different tenant.

--vault-name -v

Name of the Recovery services vault.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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]
                                         [--subscription]
                                         [--target-file-share]
                                         [--target-folder]
                                         [--target-resource-group-name]
                                         [--target-storage-account]
                                         [--tenant-id]
                                         [--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.

--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-resource-group-name --target-rg-name

Resource group of the destination storage account to which the content will be restored, needed if it is different from the vault resource group.

--target-storage-account

Destination storage account to which content will be restored.

--tenant-id

ID of the tenant if the Resource Guard protecting the vault exists in a different tenant.

--vault-name -v

Name of the Recovery services vault.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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}]
                                  [--tenant-id]
                                  [--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
--tenant-id

ID of the tenant if the Resource Guard protecting the vault exists in a different tenant.

--use-secondary-region

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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-edge-zone {false, true}]
                                [--restore-to-staging-storage-account {false, true}]
                                [--rp-name]
                                [--storage-account-resource-group]
                                [--subscription]
                                [--target-resource-group]
                                [--target-subnet-name]
                                [--target-subscription-id]
                                [--target-vm-name]
                                [--target-vnet-name]
                                [--target-vnet-resource-group]
                                [--target-zone {1, 2, 3}]
                                [--tenant-id]
                                [--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. The ID might be needed for cross-region restores where the storage account and vault are not on the same resource group. In order to get the ID, use the storage account show command as specified here (https://learn.microsoft.com/en-us/azure/storage/common/storage-account-get-info?tabs=azure-cli#get-the-resource-id-for-a-storage-account).

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

Switch parameter to indicate edge zone VM restore. This parameter can't be used in cross region and cross subscription restore scenarios.

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.

--storage-account-resource-group

Name of the resource group which contains the storage account. Default value will be same as --resource-group if not specified.

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

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

ID of the tenant if the Resource Guard protecting the vault exists in a different tenant.

--use-secondary-region

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

--vault-name -v

Name of the Recovery services vault.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.