Skip to main content

policies

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

Overview

Namepolicies
TypeResource
Idazure.cdn.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.
customRulesobjectDescribes custom rules inside the policy.
endpointLinksarrayDescribes Azure CDN endpoints associated with this Web Application Firewall policy.
etagstringGets a unique read-only string that changes whenever the resource is updated.
extendedPropertiesobjectKey-Value pair representing additional properties for Web Application Firewall policy.
locationstringThe geo-location where the resource lives. Required.
managedRulesobjectDescribes managed rules inside the policy.
policySettingsobjectDescribes policySettings for policy.
provisioningStatestringProvisioning state of the WebApplicationFirewallPolicy. Known values are: "Creating", "Succeeded", and "Failed". (Creating, Succeeded, Failed)
rateLimitRulesobjectDescribes rate limit rules inside the policy.
resourceStatestringResource status of the policy. Known values are: "Creating", "Enabling", "Enabled", "Disabling", "Disabled", and "Deleting". (Creating, Enabling, Enabled, Disabling, Disabled, Deleting)
skuobjectThe pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. Required.
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
getselectresource_group_name, policy_name, subscription_idRetrieve protection policy with specified name within a resource group.
listselectresource_group_name, subscription_idLists all of the protection policies within a resource group.
create_or_updateinsertresource_group_name, policy_name, subscription_id, location, skuCreate or update policy with specified rule set name within a resource group.
updateupdateresource_group_name, policy_name, subscription_idUpdate an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription and resource group.
create_or_updatereplaceresource_group_name, policy_name, subscription_id, location, skuCreate or update policy with specified rule set name within a resource group.
deletedeleteresource_group_name, policy_name, subscription_idDeletes Policy.

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_namestringThe name of the CdnWebApplicationFirewallPolicy. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Retrieve protection policy with specified name within a resource group.

SELECT
id,
name,
customRules,
endpointLinks,
etag,
extendedProperties,
location,
managedRules,
policySettings,
provisioningState,
rateLimitRules,
resourceState,
sku,
systemData,
tags,
type
FROM azure.cdn.policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND policy_name = '{{ policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update policy with specified rule set name within a resource group.

INSERT INTO azure.cdn.policies (
tags,
location,
properties,
etag,
sku,
resource_group_name,
policy_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ etag }}',
'{{ sku }}' /* required */,
'{{ resource_group_name }}',
'{{ policy_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription and resource group.

UPDATE azure.cdn.policies
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type;

REPLACE examples

Create or update policy with specified rule set name within a resource group.

REPLACE azure.cdn.policies
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
etag = '{{ etag }}',
sku = '{{ sku }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND sku = '{{ sku }}' --required
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Deletes Policy.

DELETE FROM azure.cdn.policies
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;