Skip to main content

workspace_policy_fragments

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

Overview

Nameworkspace_policy_fragments
TypeResource
Idazure.api_management.workspace_policy_fragments

Fields

NameDatatypeDescription
idtextfield from the properties object
descriptiontextfield from the properties object
formattextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
serviceNametextfield from the properties object
subscriptionIdtextfield from the properties object
valuetextfield from the properties object
workspaceIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTid, resourceGroupName, serviceName, subscriptionId, workspaceIdGets a policy fragment.
list_by_serviceSELECTresourceGroupName, serviceName, subscriptionId, workspaceIdGets all policy fragments defined within a workspace.
create_or_updateINSERTid, resourceGroupName, serviceName, subscriptionId, workspaceIdCreates or updates a policy fragment.
deleteDELETEIf-Match, id, resourceGroupName, serviceName, subscriptionId, workspaceIdDeletes a policy fragment.

SELECT examples

Gets all policy fragments defined within a workspace.

SELECT
id,
description,
format,
provisioning_state,
resourceGroupName,
serviceName,
subscriptionId,
value,
workspaceId
FROM azure.api_management.vw_workspace_policy_fragments
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serviceName = '{{ serviceName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceId = '{{ workspaceId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.api_management.workspace_policy_fragments (
id,
resourceGroupName,
serviceName,
subscriptionId,
workspaceId,
properties
)
SELECT
'{{ id }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ subscriptionId }}',
'{{ workspaceId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified workspace_policy_fragments resource.

/*+ delete */
DELETE FROM azure.api_management.workspace_policy_fragments
WHERE If-Match = '{{ If-Match }}'
AND id = '{{ id }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serviceName = '{{ serviceName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceId = '{{ workspaceId }}';