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

NameDatatypeDescription
idtextFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
nametextThe name of the resource
backup_management_typetextfield from the properties object
policyNametextfield from the properties object
protected_items_counttextfield from the properties object
resourceGroupNametextfield from the properties object
resource_guard_operation_requeststextfield from the properties object
subscriptionIdtextfield from the properties object
typetextThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
vaultNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTpolicyName, resourceGroupName, subscriptionId, vaultNameProvides 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_updateINSERTpolicyName, resourceGroupName, subscriptionId, vaultNameCreates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched
using GetPolicyOperationResult API.
deleteDELETEpolicyName, resourceGroupName, subscriptionId, vaultNameDeletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the
operation can be fetched using GetProtectionPolicyOperationResult API.

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,
backup_management_type,
policyName,
protected_items_count,
resourceGroupName,
resource_guard_operation_requests,
subscriptionId,
type,
vaultName
FROM azure.recovery_services_backup.vw_protection_policies
WHERE policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';

INSERT example

Use the following StackQL query and manifest file to create a new protection_policies resource.

/*+ create */
INSERT INTO azure.recovery_services_backup.protection_policies (
policyName,
resourceGroupName,
subscriptionId,
vaultName,
properties
)
SELECT
'{{ policyName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ vaultName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified protection_policies resource.

/*+ delete */
DELETE FROM azure.recovery_services_backup.protection_policies
WHERE policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';