az dataprotection backup-instance

Note

This reference is part of the dataprotection extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az dataprotection backup-instance command. Learn more about extensions.

Manage backup instance with dataprotection.

Commands

az dataprotection backup-instance adhoc-backup

Trigger adhoc backup.

az dataprotection backup-instance create

Configure backup for a resource in a backup vault.

az dataprotection backup-instance delete

Delete a backup instance in a backup vault.

az dataprotection backup-instance initialize

Initialize JSON request body for configuring backup of a resource.

az dataprotection backup-instance list

Gets a backup instances belonging to a backup vault.

az dataprotection backup-instance list-from-resourcegraph

List backup instances across subscriptions, resource groups and vaults.

az dataprotection backup-instance restore

Restore backed up instances from recovery points in a backup vault.

az dataprotection backup-instance restore initialize-for-data-recovery

Initialize restore request object to recover all backed up data in a backup vault.

az dataprotection backup-instance restore initialize-for-data-recovery-as-files

Initialize restore request object to recover all backed up data as files in a backup vault.

az dataprotection backup-instance restore initialize-for-item-recovery

Initialize restore request object to recover specified items of backed up data in a backup vault.

az dataprotection backup-instance restore trigger

Triggers restore for a BackupInstance.

az dataprotection backup-instance resume-protection

This operation will resume protection for a stopped backup instance.

az dataprotection backup-instance show

Gets a backup instance with name in a backup vault.

az dataprotection backup-instance stop-protection

This operation will stop protection of a backup instance and data will be held forever.

az dataprotection backup-instance suspend-backup

This operation will stop backups for backup instance.

az dataprotection backup-instance update-msi-permissions

Assign the required permissions needed to successfully enable backup for the datasource.

az dataprotection backup-instance update-policy

Update backup policy associated with backup instance.

az dataprotection backup-instance validate-for-backup

Validate whether configure backup will be successful or not.

az dataprotection backup-instance validate-for-restore

Validates if Restore can be triggered for a DataSource.

az dataprotection backup-instance wait

Place the CLI in a waiting state until a condition of the dataprotection backup-instance is met.

az dataprotection backup-instance adhoc-backup

Trigger adhoc backup.

az dataprotection backup-instance adhoc-backup --rule-name
                                               [--backup-instance-name]
                                               [--ids]
                                               [--no-wait]
                                               [--resource-group]
                                               [--retention-tag-override]
                                               [--subscription]
                                               [--vault-name]

Examples

Trigger Adhoc Backup

az dataprotection backup-instance adhoc-backup --name "testInstance1" --rule-name "BackupWeekly" --retention-tag-override "yearly" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1"

Required Parameters

--rule-name

Specify backup policy rule name.

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--resource-group -g

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

--retention-tag-override

Specify retention override tag.

--subscription

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

--vault-name

The name of the backup vault.

az dataprotection backup-instance create

Configure backup for a resource in a backup vault.

az dataprotection backup-instance create --backup-instance
                                         --resource-group
                                         --vault-name
                                         [--no-wait]

Examples

create a backup instance in a backup vault

az dataprotection backup-instance create -g MyResourceGroup --vault-name MyVault --backup-instance backupinstance.json

Required Parameters

--backup-instance

Request body for operation Expected value: json-string/@json-file.

--resource-group -g

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

--vault-name

The name of the backup vault.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False

az dataprotection backup-instance delete

Delete a backup instance in a backup vault.

az dataprotection backup-instance delete [--backup-instance-name]
                                         [--ids]
                                         [--no-wait]
                                         [--resource-group]
                                         [--subscription]
                                         [--vault-name]
                                         [--yes]

Examples

Delete BackupInstance

az dataprotection backup-instance delete --name "testInstance1" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1"

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

The name of the backup vault.

--yes -y

Do not prompt for confirmation.

default value: False

az dataprotection backup-instance initialize

Initialize JSON request body for configuring backup of a resource.

az dataprotection backup-instance initialize --datasource-id
                                             --datasource-location
                                             --datasource-type {AzureBlob, AzureDatabaseForPostgreSQL, AzureDisk}
                                             --policy-id
                                             [--secret-store-type {AzureKeyVault}]
                                             [--secret-store-uri]
                                             [--snapshot-resource-group-name]
                                             [--tags]

Examples

Initialize backup instance request for Azure Disk

az dataprotection backup-instance initialize --datasource-type AzureDisk -l southeastasia --policy-id {disk_policy_id} --datasource-id {disk_id}

Required Parameters

--datasource-id

ARM Id of the resource to be backed up.

--datasource-location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--datasource-type

Specify the datasource type of the resource to be backed up.

accepted values: AzureBlob, AzureDatabaseForPostgreSQL, AzureDisk
--policy-id

Id of the backup policy the datasource will be associated.

Optional Parameters

--secret-store-type

Specify the secret store type to use for authentication.

accepted values: AzureKeyVault
--secret-store-uri

Specify the secret store uri to use for authentication.

--snapshot-resource-group-name --snapshot-rg

Name of the resource group in which the backup snapshots should be stored.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

az dataprotection backup-instance list

Gets a backup instances belonging to a backup vault.

az dataprotection backup-instance list --resource-group
                                       --vault-name

Examples

List BackupInstances in a Vault

az dataprotection backup-instance list --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1"

Required Parameters

--resource-group -g

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

--vault-name

The name of the backup vault.

az dataprotection backup-instance list-from-resourcegraph

List backup instances across subscriptions, resource groups and vaults.

az dataprotection backup-instance list-from-resourcegraph --datasource-type {AzureBlob, AzureDatabaseForPostgreSQL, AzureDisk}
                                                          [--datasource-id]
                                                          [--protection-status {ProtectionConfigured, ProtectionError}]
                                                          [--resource-groups]
                                                          [--subscriptions]
                                                          [--vaults]

Examples

list backup instances across multiple vaults across multiple resource groups

az dataprotection backup-instance list-from-resourcegraph --resource-groups resourceGroup1 resourceGroup2 --vaults vault1 vault2 --datasource-type AzureBlob

list backup instances in a vault which are in a protection error state.

az dataprotection backup-instance list-from-resourcegraph --resource-groups resourceGroup --vaults vault --protection-status ProtectionError --datasource-type AzureDisk

Required Parameters

--datasource-type

Specify the datasource type.

accepted values: AzureBlob, AzureDatabaseForPostgreSQL, AzureDisk

Optional Parameters

--datasource-id

Specify datasource id filter to apply.

--protection-status

Specify protection status.

accepted values: ProtectionConfigured, ProtectionError
--resource-groups

List of resource groups.

--subscriptions

List of subscription Ids.

--vaults

List of vault names.

az dataprotection backup-instance resume-protection

This operation will resume protection for a stopped backup instance.

az dataprotection backup-instance resume-protection [--backup-instance-name]
                                                    [--ids]
                                                    [--no-wait]
                                                    [--resource-group]
                                                    [--subscription]
                                                    [--vault-name]

Examples

ResumeProtection

az dataprotection backup-instance resume-protection --name "testbi" --resource-group "testrg" --vault-name "testvault"

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

The name of the backup vault.

az dataprotection backup-instance show

Gets a backup instance with name in a backup vault.

az dataprotection backup-instance show [--backup-instance-name]
                                       [--ids]
                                       [--resource-group]
                                       [--subscription]
                                       [--vault-name]

Examples

Get BackupInstance

az dataprotection backup-instance show --name "testInstance1" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1"

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

The name of the backup vault.

az dataprotection backup-instance stop-protection

This operation will stop protection of a backup instance and data will be held forever.

az dataprotection backup-instance stop-protection [--backup-instance-name]
                                                  [--ids]
                                                  [--no-wait]
                                                  [--resource-group]
                                                  [--subscription]
                                                  [--vault-name]

Examples

StopProtection

az dataprotection backup-instance stop-protection --name "testbi" --resource-group "testrg" --vault-name "testvault"

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

The name of the backup vault.

az dataprotection backup-instance suspend-backup

This operation will stop backups for backup instance.

az dataprotection backup-instance suspend-backup [--backup-instance-name]
                                                 [--ids]
                                                 [--no-wait]
                                                 [--resource-group]
                                                 [--subscription]
                                                 [--vault-name]

Examples

SuspendBackups

az dataprotection backup-instance suspend-backup --name "testbi" --resource-group "testrg" --vault-name "testvault"

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

The name of the backup vault.

az dataprotection backup-instance update-msi-permissions

Assign the required permissions needed to successfully enable backup for the datasource.

az dataprotection backup-instance update-msi-permissions --datasource-type {AzureBlob, AzureDatabaseForPostgreSQL, AzureDisk}
                                                         --operation {Backup}
                                                         --permissions-scope {Resource, ResourceGroup, Subscription}
                                                         --resource-group
                                                         --vault-name
                                                         [--backup-instance]
                                                         [--keyvault-id]
                                                         [--yes]

Examples

Assign the required permissions needed to successfully enable backup for the datasource.

az dataprotection backup-instance update-msi-permissions --backup-instance backup_inst.json --resource-group samarth_resource_group --vault-name samarthbackupvault --datasource-type AzureDisk --operation Backup --permissions-scope ResourceGroup

Required Parameters

--datasource-type

Specify the datasource type of the resource to be backed up.

accepted values: AzureBlob, AzureDatabaseForPostgreSQL, AzureDisk
--operation

List of possible operations.

accepted values: Backup
--permissions-scope

Scope for assigning permissions to the backup vault.

accepted values: Resource, ResourceGroup, Subscription
--resource-group -g

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

--vault-name

Name of the vault.

Optional Parameters

--backup-instance

Request body for operation Expected value: json-string/@json-file. Required when --operation is Backup.

--keyvault-id

ARM id of the key vault. Required when --datasource-type is AzureDatabaseForPostgreSQL.

--yes -y

Do not prompt for confirmation.

default value: False

az dataprotection backup-instance update-policy

Update backup policy associated with backup instance.

az dataprotection backup-instance update-policy --backup-instance-name
                                                --policy-id
                                                --resource-group
                                                --vault-name
                                                [--no-wait]

Examples

Update backup policy associated with backup instance

az dataprotection backup-instance update-policy --backup-instance-name MyDisk1 --policy-id {policy_id} -g MyResourceGroup --vault-name MyVault

Required Parameters

--backup-instance-name

Backup instance name.

--policy-id

Specify the ID of the new policy with which backup instance will be associated with.

--resource-group -g

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

--vault-name

Name of the vault.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False

az dataprotection backup-instance validate-for-backup

Validate whether configure backup will be successful or not.

az dataprotection backup-instance validate-for-backup --backup-instance
                                                      [--ids]
                                                      [--no-wait]
                                                      [--resource-group]
                                                      [--subscription]
                                                      [--vault-name]

Examples

Validate for backup

az dataprotection backup-instance validate-for-backup -g sarath-rg --vault-name sarath-vault --backup-instance backup_instance.json

Required Parameters

--backup-instance

Request body for operation Expected value: json-string/@json-file.

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.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

The name of the backup vault.

az dataprotection backup-instance validate-for-restore

Validates if Restore can be triggered for a DataSource.

az dataprotection backup-instance validate-for-restore --restore-request-object
                                                       [--backup-instance-name]
                                                       [--ids]
                                                       [--no-wait]
                                                       [--resource-group]
                                                       [--subscription]
                                                       [--vault-name]

Examples

Validate Restore

az dataprotection backup-instance validate-for-restore --name "testInstance1" --restore-request-object "{\"objectType\":\"AzureBackupRecoveryPointBasedRestoreRequest\",\"recoveryPointId\":\"hardcodedRP\",\"restoreTargetInfo\":{\"datasourceAuthCredentials\":{\"objectType\":\"SecretStoreBasedAuthCredentials\",\"secretStoreResource\":{\"secretStoreType\":\"AzureKeyVault\",\"uri\":\"https://samplevault.vault.azure.net/secrets/credentials\"}},\"datasourceInfo\":{\"datasourceType\":\"Microsoft.DBforPostgreSQL/servers/databases\",\"objectType\":\"Datasource\",\"resourceID\":\"/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb\",\"resourceLocation\":\"\",\"resourceName\":\"targetdb\",\"resourceType\":\"Microsoft.DBforPostgreSQL/servers/databases\",\"resourceUri\":\"\"},\"datasourceSetInfo\":{\"datasourceType\":\"Microsoft.DBforPostgreSQL/servers/databases\",\"objectType\":\"DatasourceSet\",\"resourceID\":\"/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest\",\"resourceLocation\":\"\",\"resourceName\":\"viveksipgtest\",\"resourceType\":\"Microsoft.DBforPostgreSQL/servers\",\"resourceUri\":\"\"},\"objectType\":\"RestoreTargetInfo\",\"recoveryOption\":\"FailIfExists\",\"restoreLocation\":\"southeastasia\"},\"sourceDataStoreType\":\"VaultStore\",\"sourceResourceId\":\"/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb\"}" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1"

Required Parameters

--restore-request-object

Gets or sets the restore request object. Expected value: json-string/@json-file.

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

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

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

The name of the backup vault.

az dataprotection backup-instance wait

Place the CLI in a waiting state until a condition of the dataprotection backup-instance is met.

az dataprotection backup-instance wait [--backup-instance-name]
                                       [--created]
                                       [--custom]
                                       [--deleted]
                                       [--exists]
                                       [--ids]
                                       [--interval]
                                       [--resource-group]
                                       [--subscription]
                                       [--timeout]
                                       [--updated]
                                       [--vault-name]

Examples

Pause executing next line of CLI script until the dataprotection backup-instance is successfully created.

az dataprotection backup-instance wait --name "testInstance1" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1" --created

Pause executing next line of CLI script until the dataprotection backup-instance is successfully deleted.

az dataprotection backup-instance wait --name "testInstance1" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1" --deleted

Optional Parameters

--backup-instance-name --name -n

The name of the backup instance.

--created

Wait until created with 'provisioningState' at 'Succeeded'.

default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

default value: False
--exists

Wait until the resource exists.

default value: False
--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.

--interval

Polling interval in seconds.

default value: 30
--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.

--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

default value: False
--vault-name

The name of the backup vault.