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
propertiesobjectProtectionPolicyResource properties
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
getselectvaultName, resourceGroupName, subscriptionId, policyNameapi-versionProvides 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_updateinsertvaultName, resourceGroupName, subscriptionId, policyNameapi-version, x-ms-authorization-auxiliaryCreates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched
using GetPolicyOperationResult API.
deletedeletevaultName, resourceGroupName, subscriptionId, policyNameapi-versionDeletes 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
policyNamestringBackup policy to be deleted.
resourceGroupNamestringThe name of the resource group where the recovery services vault is present.
subscriptionIdstringThe subscription Id.
vaultNamestringThe name of the recovery services vault.
api-versionstringClient Api Version.
x-ms-authorization-auxiliarystring

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,
properties,
type
FROM azure.recovery_services_backup.protection_policies
WHERE vaultName = '{{ vaultName }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND policyName = '{{ policyName }}' -- required
AND api-version = '{{ api-version }}'
;

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 (
data__properties,
vaultName,
resourceGroupName,
subscriptionId,
policyName,
api-version,
x-ms-authorization-auxiliary
)
SELECT
'{{ properties }}',
'{{ vaultName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ policyName }}',
'{{ api-version }}',
'{{ x-ms-authorization-auxiliary }}'
RETURNING
id,
name,
properties,
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 vaultName = '{{ vaultName }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND policyName = '{{ policyName }}' --required
AND api-version = '{{ api-version }}'
;