Skip to main content

api_policies

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

Overview

Nameapi_policies
TypeResource
Idazure.api_management.api_policies

Fields

NameDatatypeDescription
apiIdtextfield from the properties object
formattextfield from the properties object
policyIdtextfield from the properties object
resourceGroupNametextfield from the properties object
serviceNametextfield from the properties object
subscriptionIdtextfield from the properties object
valuetextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTapiId, policyId, resourceGroupName, serviceName, subscriptionIdGet the policy configuration at the API level.
list_by_apiSELECTapiId, resourceGroupName, serviceName, subscriptionIdGet the policy configuration at the API level.
create_or_updateINSERTapiId, policyId, resourceGroupName, serviceName, subscriptionIdCreates or updates policy configuration for the API.
deleteDELETEIf-Match, apiId, policyId, resourceGroupName, serviceName, subscriptionIdDeletes the policy configuration at the Api.

SELECT examples

Get the policy configuration at the API level.

SELECT
apiId,
format,
policyId,
resourceGroupName,
serviceName,
subscriptionId,
value
FROM azure.api_management.vw_api_policies
WHERE apiId = '{{ apiId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serviceName = '{{ serviceName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.api_management.api_policies (
apiId,
policyId,
resourceGroupName,
serviceName,
subscriptionId,
properties
)
SELECT
'{{ apiId }}',
'{{ policyId }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified api_policies resource.

/*+ delete */
DELETE FROM azure.api_management.api_policies
WHERE If-Match = '{{ If-Match }}'
AND apiId = '{{ apiId }}'
AND policyId = '{{ policyId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serviceName = '{{ serviceName }}'
AND subscriptionId = '{{ subscriptionId }}';