Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idazure.api_management.subscriptions

Fields

NameDatatypeDescription
allow_tracingtextfield from the properties object
created_datetextfield from the properties object
display_nametextfield from the properties object
end_datetextfield from the properties object
expiration_datetextfield from the properties object
notification_datetextfield from the properties object
owner_idtextfield from the properties object
primary_keytextfield from the properties object
resourceGroupNametextfield from the properties object
scopetextfield from the properties object
secondary_keytextfield from the properties object
serviceNametextfield from the properties object
sidtextfield from the properties object
start_datetextfield from the properties object
statetextfield from the properties object
state_commenttextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, serviceName, sid, subscriptionIdGets the specified Subscription entity.
listSELECTresourceGroupName, serviceName, subscriptionIdLists all subscriptions of the API Management service instance.
create_or_updateINSERTresourceGroupName, serviceName, sid, subscriptionIdCreates or updates the subscription of specified user to the specified product.
deleteDELETEIf-Match, resourceGroupName, serviceName, sid, subscriptionIdDeletes the specified subscription.
updateUPDATEIf-Match, resourceGroupName, serviceName, sid, subscriptionIdUpdates the details of a subscription specified by its identifier.
regenerate_primary_keyEXECresourceGroupName, serviceName, sid, subscriptionIdRegenerates primary key of existing subscription of the API Management service instance.
regenerate_secondary_keyEXECresourceGroupName, serviceName, sid, subscriptionIdRegenerates secondary key of existing subscription of the API Management service instance.

SELECT examples

Lists all subscriptions of the API Management service instance.

SELECT
allow_tracing,
created_date,
display_name,
end_date,
expiration_date,
notification_date,
owner_id,
primary_key,
resourceGroupName,
scope,
secondary_key,
serviceName,
sid,
start_date,
state,
state_comment,
subscriptionId
FROM azure.api_management.vw_subscriptions
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serviceName = '{{ serviceName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

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

UPDATE example

Updates a subscriptions resource.

/*+ update */
UPDATE azure.api_management.subscriptions
SET
properties = '{{ properties }}'
WHERE
If-Match = '{{ If-Match }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serviceName = '{{ serviceName }}'
AND sid = '{{ sid }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified subscriptions resource.

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