az backup policy
A backup policy defines when you want to take a backup and for how long you would retain each backup copy.
Commands
Name | Description | Type | Status |
---|---|---|---|
az backup policy create |
Create a new policy for the given BackupManagementType and workloadType. |
Core | GA |
az backup policy delete |
Delete a backup policy which doesn't have any associated backup items. |
Core | GA |
az backup policy get-default-for-vm |
Get the default policy with default values to backup a VM. |
Core | GA |
az backup policy list |
List all policies for a Recovery services vault. |
Core | GA |
az backup policy list-associated-items |
List all items protected by a backup policy. |
Core | GA |
az backup policy set |
Update the existing policy with the provided details. |
Core | GA |
az backup policy show |
Show details of a particular policy. |
Core | GA |
az backup policy create
Create a new policy for the given BackupManagementType and workloadType.
az backup policy create --backup-management-type {AzureIaasVM, AzureStorage, AzureWorkload}
--name
--policy
--resource-group
--vault-name
[--workload-type {AzureFileShare, MSSQL, SAPHANA, SAPHanaDatabase, SQLDataBase, VM}]
Examples
Create a new policy for the given BackupManagementType and workloadType.
az backup policy create --policy {policy} --resource-group MyResourceGroup --vault-name MyVault --name MyPolicy --backup-management-type AzureStorage
Required Parameters
Specify the backup management type. Define how Azure Backup manages the backup of entities within the ARM resource. For eg: AzureWorkloads refers to workloads installed within Azure VMs, AzureStorage refers to entities within Storage account. Required only if friendly name is used as Container name.
Name of the Policy.
JSON encoded policy definition. Use the show command with JSON output to obtain a policy object. Modify the values using a file editor and pass the object.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the Recovery services vault.
Optional Parameters
Specify the type of applications within the Resource which should be discovered and protected by Azure Backup. 'MSSQL' and 'SQLDataBase' can be used interchangeably for SQL in Azure VM, as can 'SAPHANA' and 'SAPHanaDatabase' for SAP HANA in Azure VM.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az backup policy delete
Delete a backup policy which doesn't have any associated backup items.
az backup policy delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--vault-name]
Examples
Before you can delete a Backup protection policy, the policy must not have any associated Backup items. To associate another policy with a Backup item, use the backup item set-policy command.
az backup policy delete --name MyBackupPolicy --resource-group MyResourceGroup --vault-name MyVault
Optional Parameters
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.
Name of the backup policy. You can use the backup policy list command to get the name of a policy.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Name of the Recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az backup policy get-default-for-vm
Get the default policy with default values to backup a VM.
az backup policy get-default-for-vm --resource-group
--vault-name
Examples
Get the default policy with default values to backup a VM. (autogenerated)
az backup policy get-default-for-vm --resource-group MyResourceGroup --vault-name MyVault
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the Recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az backup policy list
List all policies for a Recovery services vault.
az backup policy list --resource-group
--vault-name
[--backup-management-type {AzureIaasVM, AzureStorage, AzureWorkload}]
[--move-to-archive-tier {All, Disabled, Enabled}]
[--policy-sub-type {Enhanced, Standard}]
[--workload-type {AzureFileShare, MSSQL, SAPHANA, SAPHanaDatabase, SQLDataBase, VM}]
Examples
List all policies for a Recovery services vault. (autogenerated)
az backup policy list --resource-group MyResourceGroup --vault-name MyVault
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the Recovery services vault.
Optional Parameters
Specify the backup management type. Define how Azure Backup manages the backup of entities within the ARM resource. For eg: AzureWorkloads refers to workloads installed within Azure VMs, AzureStorage refers to entities within Storage account. Required only if friendly name is used as Container name.
Parameter that specifies whether to only list policies where archive tier move is enabled/disabled.
Sub type of policies to be retrieved. To list standard backup policies, specify ‘Standard’ as the value of this parameter. To list enhanced backup policies for Azure VMs, specify ‘Enhanced’ as the value of this parameter.
Specify the type of applications within the Resource which should be discovered and protected by Azure Backup. 'MSSQL' and 'SQLDataBase' can be used interchangeably for SQL in Azure VM, as can 'SAPHANA' and 'SAPHanaDatabase' for SAP HANA in Azure VM.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az backup policy list-associated-items
List all items protected by a backup policy.
az backup policy list-associated-items [--backup-management-type {AzureIaasVM, AzureStorage, AzureWorkload}]
[--ids]
[--name]
[--resource-group]
[--subscription]
[--vault-name]
Examples
List all items protected by a backup policy
az backup policy list-associated-items --name MyBackupPolicy --resource-group MyResourceGroup --vault-name MyVault --backup-management-type AzureIaasVM
Optional Parameters
Specify the backup management type. Define how Azure Backup manages the backup of entities within the ARM resource. For eg: AzureWorkloads refers to workloads installed within Azure VMs, AzureStorage refers to entities within Storage account. Required only if friendly name is used as Container name.
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.
Name of the backup policy. You can use the backup policy list command to get the name of a policy.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Name of the Recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az backup policy set
Update the existing policy with the provided details.
az backup policy set [--backup-management-type {AzureIaasVM, AzureStorage, AzureWorkload}]
[--fix-for-inconsistent-items {false, true}]
[--ids]
[--name]
[--policy]
[--resource-group]
[--subscription]
[--tenant-id]
[--vault-name]
Examples
Update the existing policy with the provided details. (autogenerated)
az backup policy set --policy {policy} --resource-group MyResourceGroup --vault-name MyVault
Optional Parameters
Specify the backup management type. Define how Azure Backup manages the backup of entities within the ARM resource. For eg: AzureWorkloads refers to workloads installed within Azure VMs, AzureStorage refers to entities within Storage account. Required only if friendly name is used as Container name.
Specify whether or not to retry Policy Update for failed items.
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.
Name of the Policy.
JSON encoded policy definition. Use the show command with JSON output to obtain a policy object. Modify the values using a file editor and pass the object.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
ID of the tenant if the Resource Guard protecting the vault exists in a different tenant.
Name of the Recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az backup policy show
Show details of a particular policy.
az backup policy show [--ids]
[--name]
[--resource-group]
[--subscription]
[--vault-name]
Examples
Show details of a particular policy
az backup policy show --name MyBackupPolicy --resource-group MyResourceGroup --vault-name MyVault
Optional Parameters
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.
Name of the backup policy. You can use the backup policy list command to get the name of a policy.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Name of the Recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI