Skip to main content

protection_policies

Creates, updates, deletes, gets or lists a protection_policies resource.

Overview

Nameprotection_policies
TypeResource
Idazure.recovery_services_backup.protection_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
backupManagementTypestringThis property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. Required. Default value is None.
eTagstringOptional ETag.
locationstringThe geo-location where the resource lives.
protectedItemsCountintegerNumber of items associated with this policy.
resourceGuardOperationRequestsarrayResourceGuard Operation Requests.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectvault_name, resource_group_name, policy_name, subscription_idProvides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.
create_or_updateinsertvault_name, resource_group_name, policy_name, subscription_idx-ms-authorization-auxiliaryCreates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.
create_or_updatereplacevault_name, resource_group_name, policy_name, subscription_idx-ms-authorization-auxiliaryCreates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.
deletedeletevault_name, resource_group_name, policy_name, subscription_idDeletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetProtectionPolicyOperationResult API.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
policy_namestringBackup policy information to be fetched. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
vault_namestringThe name of the VaultResource. Required.
x-ms-authorization-auxiliarystringDefault value is None.

SELECT examples

Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.

SELECT
id,
name,
backupManagementType,
eTag,
location,
protectedItemsCount,
resourceGuardOperationRequests,
systemData,
tags,
type
FROM azure.recovery_services_backup.protection_policies
WHERE vault_name = '{{ vault_name }}' -- required
AND resource_group_name = '{{ resource_group_name }}' -- required
AND policy_name = '{{ policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.

INSERT INTO azure.recovery_services_backup.protection_policies (
properties,
tags,
location,
eTag,
vault_name,
resource_group_name,
policy_name,
subscription_id,
x-ms-authorization-auxiliary
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ eTag }}',
'{{ vault_name }}',
'{{ resource_group_name }}',
'{{ policy_name }}',
'{{ subscription_id }}',
'{{ x-ms-authorization-auxiliary }}'
RETURNING
id,
name,
eTag,
location,
properties,
systemData,
tags,
type
;

REPLACE examples

Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.

REPLACE azure.recovery_services_backup.protection_policies
SET
properties = '{{ properties }}',
tags = '{{ tags }}',
location = '{{ location }}',
eTag = '{{ eTag }}'
WHERE
vault_name = '{{ vault_name }}' --required
AND resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND x-ms-authorization-auxiliary = '{{ x-ms-authorization-auxiliary}}'
RETURNING
id,
name,
eTag,
location,
properties,
systemData,
tags,
type;

DELETE examples

Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetProtectionPolicyOperationResult API.

DELETE FROM azure.recovery_services_backup.protection_policies
WHERE vault_name = '{{ vault_name }}' --required
AND resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;