Skip to main content

backup_policies

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

Overview

Namebackup_policies
TypeResource
Idazure.data_protection.backup_policies

Fields

NameDatatypeDescription
idtextResource Id represents the complete path to the resource.
nametextResource name associated with the resource.
backupPolicyNametextfield from the properties object
datasource_typestextfield from the properties object
object_typetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
typetextResource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
vaultNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupPolicyName, resourceGroupName, subscriptionId, vaultNameGets a backup policy belonging to a backup vault
listSELECTresourceGroupName, subscriptionId, vaultNameReturns list of backup policies belonging to a backup vault
create_or_updateINSERTbackupPolicyName, resourceGroupName, subscriptionId, vaultName
deleteDELETEbackupPolicyName, resourceGroupName, subscriptionId, vaultName

SELECT examples

Returns list of backup policies belonging to a backup vault

SELECT
id,
name,
backupPolicyName,
datasource_types,
object_type,
resourceGroupName,
subscriptionId,
system_data,
type,
vaultName
FROM azure.data_protection.vw_backup_policies
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';

INSERT example

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

/*+ create */
INSERT INTO azure.data_protection.backup_policies (
backupPolicyName,
resourceGroupName,
subscriptionId,
vaultName,
systemData,
properties
)
SELECT
'{{ backupPolicyName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ vaultName }}',
'{{ systemData }}',
'{{ properties }}'
;

DELETE example

Deletes the specified backup_policies resource.

/*+ delete */
DELETE FROM azure.data_protection.backup_policies
WHERE backupPolicyName = '{{ backupPolicyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';