Skip to main content

policies

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

Overview

Namepolicies
TypeResource
Idazure.api_management.policies

Fields

The following fields are returned by SELECT queries:

Get the Global policy definition of the Api Management service.

NameDatatypeDescription
propertiesobjectProperties of the Policy.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, serviceName, policyId, subscriptionIdformatGet the Global policy definition of the Api Management service.
list_by_serviceselectresourceGroupName, serviceName, subscriptionIdLists all the Global Policy definitions of the Api Management service.
create_or_updateinsertresourceGroupName, serviceName, policyId, subscriptionIdIf-MatchCreates or updates the global policy configuration of the Api Management service.
deletedeleteresourceGroupName, serviceName, policyId, If-Match, subscriptionIdDeletes the global policy configuration of the Api Management Service.

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
If-MatchstringETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
policyIdstringThe identifier of the Policy.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
subscriptionIdstringThe ID of the target subscription.
If-MatchstringETag of the Entity. Not required when creating an entity, but required when updating an entity.
formatstringPolicy Export Format.

SELECT examples

Get the Global policy definition of the Api Management service.

SELECT
properties
FROM azure.api_management.policies
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND policyId = '{{ policyId }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND format = '{{ format }}'
;

INSERT examples

Creates or updates the global policy configuration of the Api Management service.

INSERT INTO azure.api_management.policies (
data__properties,
resourceGroupName,
serviceName,
policyId,
subscriptionId,
If-Match
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ policyId }}',
'{{ subscriptionId }}',
'{{ If-Match }}'
RETURNING
properties
;

DELETE examples

Deletes the global policy configuration of the Api Management Service.

DELETE FROM azure.api_management.policies
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND policyId = '{{ policyId }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;