Skip to main content

workspace_subscriptions

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

Overview

Nameworkspace_subscriptions
TypeResource
Idazure.api_management.workspace_subscriptions

Fields

The following fields are returned by SELECT queries:

The response body contains the specified Subscription entity.

NameDatatypeDescription
propertiesobjectSubscription contract properties.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, serviceName, workspaceId, sid, subscriptionIdGets the specified Subscription entity.
listselectresourceGroupName, serviceName, workspaceId, subscriptionId$filter, $top, $skipLists all subscriptions of the workspace in an API Management service instance.
create_or_updateinsertresourceGroupName, serviceName, workspaceId, sid, subscriptionIdnotify, If-Match, appTypeCreates or updates the subscription of specified user to the specified product.
updateupdateresourceGroupName, serviceName, workspaceId, sid, If-Match, subscriptionIdnotify, appTypeUpdates the details of a subscription specified by its identifier.
deletedeleteresourceGroupName, serviceName, workspaceId, sid, If-Match, subscriptionIdDeletes the specified subscription.
regenerate_primary_keyexecresourceGroupName, serviceName, workspaceId, sid, subscriptionIdRegenerates primary key of existing subscription of the workspace in an API Management service instance.
regenerate_secondary_keyexecresourceGroupName, serviceName, workspaceId, sid, subscriptionIdRegenerates secondary key of existing subscription of the workspace in an API Management service instance.

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.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
sidstringSubscription entity Identifier. The entity represents the association between a user and a product in API Management.
subscriptionIdstringThe ID of the target subscription.
workspaceIdstringWorkspace identifier. Must be unique in the current API Management service instance.
$filterstring| Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | | |</br>
$skipinteger (int32)Number of records to skip.
$topinteger (int32)Number of records to return.
If-MatchstringETag of the Entity. Not required when creating an entity, but required when updating an entity.
appTypestringDetermines the type of application which send the create user request. Default is legacy publisher portal.
notifybooleanNotify change in Subscription State. - If false, do not send any email notification for change of state of subscription - If true, send email notification of change of state of subscription

SELECT examples

Gets the specified Subscription entity.

SELECT
properties
FROM azure.api_management.workspace_subscriptions
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND workspaceId = '{{ workspaceId }}' -- required
AND sid = '{{ sid }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates the subscription of specified user to the specified product.

INSERT INTO azure.api_management.workspace_subscriptions (
data__properties,
resourceGroupName,
serviceName,
workspaceId,
sid,
subscriptionId,
notify,
If-Match,
appType
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ workspaceId }}',
'{{ sid }}',
'{{ subscriptionId }}',
'{{ notify }}',
'{{ If-Match }}',
'{{ appType }}'
RETURNING
properties
;

UPDATE examples

Updates the details of a subscription specified by its identifier.

UPDATE azure.api_management.workspace_subscriptions
SET
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND workspaceId = '{{ workspaceId }}' --required
AND sid = '{{ sid }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND notify = {{ notify}}
AND appType = '{{ appType}}'
RETURNING
properties;

DELETE examples

Deletes the specified subscription.

DELETE FROM azure.api_management.workspace_subscriptions
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND workspaceId = '{{ workspaceId }}' --required
AND sid = '{{ sid }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

Regenerates primary key of existing subscription of the workspace in an API Management service instance.

EXEC azure.api_management.workspace_subscriptions.regenerate_primary_key 
@resourceGroupName='{{ resourceGroupName }}' --required,
@serviceName='{{ serviceName }}' --required,
@workspaceId='{{ workspaceId }}' --required,
@sid='{{ sid }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;