Skip to main content

user_subscription

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

Overview

Nameuser_subscription
TypeResource
Idazure.api_management.user_subscription

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
allowTracingbooleanDetermines whether tracing is enabled.
createdDatestring (date-time)Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
displayNamestringThe name of the subscription, or null if the subscription has no name.
endDatestring (date-time)Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
expirationDatestring (date-time)Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
notificationDatestring (date-time)Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
ownerIdstringThe user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier.
primaryKeystringSubscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
scopestringScope like /products/{productId} or /apis or /apis/{apiId}. Required.
secondaryKeystringSubscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
startDatestring (date-time)Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
statestringSubscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Required. Known values are: "suspended", "active", "expired", "submitted", "rejected", and "cancelled". (suspended, active, expired, submitted, rejected, cancelled)
stateCommentstringOptional subscription comment added by an administrator when the state is changed to the 'rejected'.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, service_name, user_id, sid, subscription_idGets the specified Subscription entity associated with a particular user.
listselectresource_group_name, service_name, user_id, subscription_id$filter, $top, $skipLists the collection of subscriptions of the specified user.

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
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
service_namestringThe name of the API Management service. Required.
sidstringSubscription entity Identifier. The entity represents the association between a user and a product in API Management. Required.
subscription_idstring
user_idstringUser identifier. Must be unique in the current API Management service instance. Required.
$filterstring| Field | Usage | Supported operators | Supported functions ||-------------|------------------------|-----------------------------------||name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith ||displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith ||stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith ||ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith ||scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith ||userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith ||productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |. Default value is None.
$skipintegerNumber of records to skip. Default value is None.
$topintegerNumber of records to return. Default value is None.

SELECT examples

Gets the specified Subscription entity associated with a particular user.

SELECT
id,
name,
allowTracing,
createdDate,
displayName,
endDate,
expirationDate,
notificationDate,
ownerId,
primaryKey,
scope,
secondaryKey,
startDate,
state,
stateComment,
systemData,
type
FROM azure.api_management.user_subscription
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND user_id = '{{ user_id }}' -- required
AND sid = '{{ sid }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;