az backup protection

Manage protection of your items, enable protection or disable it, or take on-demand backups.

Commands

az backup protection backup-now Perform an on-demand backup of a backed up item.
az backup protection check-vm Find out whether the virtual machine is protected or not. If protected, it returns the recovery services vault ID, otherwise it returns empty.
az backup protection disable Stop protecting a backed up Azure VM.
az backup protection enable-for-vm Start protecting a previously unprotected Azure VM as per the specified policy to a Recovery services vault.

az backup protection backup-now

Perform an on-demand backup of a backed up item.

az backup protection backup-now --container-name
--item-name
--retain-until
[--ids]
[--resource-group]
[--subscription]
[--vault-name]

Examples

Perform an on-demand backup of a backed up item. (autogenerated)

az backup protection backup-now --container-name MyContainer --item-name MyItem --resource-group MyResourceGroup --retain-until 01-02-2018 --vault-name MyVault

Required Parameters

--container-name -c

Name of the container.

--item-name -i

Name of the backed up item.

--retain-until

The date until which this backed up copy will be available for retrieval, in UTC (d-m-Y).

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--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 protection check-vm

Find out whether the virtual machine is protected or not. If protected, it returns the recovery services vault ID, otherwise it returns empty.

az backup protection check-vm --vm-id
[--subscription]

Examples

Find out whether the virtual machine is protected or not. If protected, it returns the recovery services vault ID, otherwise it returns empty. (autogenerated)

az backup protection check-vm --vm-id {vm-id}

Required Parameters

--vm-id

ID of the virtual machine to be checked for protection.

Optional Parameters

--subscription

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

az backup protection disable

Stop protecting a backed up Azure VM.

az backup protection disable --container-name
--item-name
[--delete-backup-data {false, true}]
[--ids]
[--resource-group]
[--subscription]
[--vault-name]
[--yes]

Examples

Stop protecting a backed up Azure VM. (autogenerated)

az backup protection disable --container-name MyContainer --delete-backup-data false --item-name MyItem --resource-group MyResourceGroup --vault-name MyVault --yes

Required Parameters

--container-name -c

Name of the container.

--item-name -i

Name of the backed up item.

Optional Parameters

--delete-backup-data

Option to delete existing backed up data in the Recovery services vault.

accepted values: false, true
--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

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

--yes -y

Do not prompt for confirmation.

az backup protection enable-for-vm

Start protecting a previously unprotected Azure VM as per the specified policy to a Recovery services vault.

az backup protection enable-for-vm --policy-name
--vm
[--ids]
[--resource-group]
[--subscription]
[--vault-name]

Examples

Start protecting a previously unprotected Azure VM as per the specified policy to a Recovery services vault. (autogenerated)

az backup protection enable-for-vm --policy-name MyPolicy --resource-group MyResourceGroup --vault-name MyVault --vm myVM

Required Parameters

--policy-name -p

Name of the backup policy.

--vm

Name or ID of the Virtual Machine to be protected.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

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