Skip to main content

policies

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

Overview

Namepolicies
TypeResource
Idazure.dev_test_labs.policies

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
descriptiontextfield from the properties object
created_datetextfield from the properties object
evaluator_typetextfield from the properties object
fact_datatextfield from the properties object
fact_nametextfield from the properties object
labNametextfield from the properties object
locationtextThe location of the resource.
policySetNametextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
statustextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
thresholdtextfield from the properties object
typetextThe type of the resource.
unique_identifiertextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, name, policySetName, resourceGroupName, subscriptionIdGet policy.
listSELECTlabName, policySetName, resourceGroupName, subscriptionIdList policies in a given policy set.
create_or_updateINSERTlabName, name, policySetName, resourceGroupName, subscriptionId, data__propertiesCreate or replace an existing policy.
deleteDELETElabName, name, policySetName, resourceGroupName, subscriptionIdDelete policy.
updateUPDATElabName, name, policySetName, resourceGroupName, subscriptionIdAllows modifying tags of policies. All other properties will be ignored.

SELECT examples

List policies in a given policy set.

SELECT
id,
name,
description,
created_date,
evaluator_type,
fact_data,
fact_name,
labName,
location,
policySetName,
provisioning_state,
resourceGroupName,
status,
subscriptionId,
tags,
threshold,
type,
unique_identifier
FROM azure.dev_test_labs.vw_policies
WHERE labName = '{{ labName }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.dev_test_labs.policies (
labName,
name,
policySetName,
resourceGroupName,
subscriptionId,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ policySetName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a policies resource.

/*+ update */
UPDATE azure.dev_test_labs.policies
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified policies resource.

/*+ delete */
DELETE FROM azure.dev_test_labs.policies
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';