Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Identra_id.directory.subscriptions

Fields

The following fields are returned by SELECT queries:

Retrieved navigation property

NameDatatypeDescription
idstringThe unique identifier for an entity. Read-only.
commerceSubscriptionIdstringThe ID of this subscription in the commerce system. Alternate key.
createdDateTimestring (date-time)The date and time when this subscription was created. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$)
isTrialbooleanWhether the subscription is a free trial or purchased.
nextLifecycleDateTimestring (date-time)The date and time when the subscription will move to the next state (as defined by the status property) if not renewed by the tenant. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$)
ownerIdstringThe object ID of the account admin.
ownerTenantIdstringThe unique identifier for the Microsoft partner tenant that created the subscription on a customer tenant.
ownerTypestringIndicates the entity that ownerId belongs to, for example, 'User'.
serviceStatusarrayThe provisioning status of each service included in this subscription.
skuIdstringThe object ID of the SKU associated with this subscription.
skuPartNumberstringThe SKU associated with this subscription.
statusstringThe status of this subscription. The possible values are: Enabled, Deleted, Suspended, Warning, LockedOut.
totalLicensesnumber (int32)The number of licenses included in this subscription.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcommerce_subscription_idGet a specific commercial subscription that an organization acquired.
get_2selectcompany_subscription_idGet a specific commercial subscription that an organization acquired.
listselectGet the list of commercial subscriptions that an organization acquired.
insertinsert
updateupdatecommerce_subscription_id
update_2updatecompany_subscription_id
deletedeletecommerce_subscription_idIf-Match
delete_2deletecompany_subscription_idIf-Match

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
commerce_subscription_idstringAlternate key of companySubscription
company_subscription_idstringThe unique identifier of companySubscription
If-MatchstringETag

SELECT examples

Get a specific commercial subscription that an organization acquired.

SELECT
id,
commerceSubscriptionId,
createdDateTime,
isTrial,
nextLifecycleDateTime,
ownerId,
ownerTenantId,
ownerType,
serviceStatus,
skuId,
skuPartNumber,
status,
totalLicenses
FROM entra_id.directory.subscriptions
WHERE commerce_subscription_id = '{{ commerce_subscription_id }}' -- required
;

INSERT examples

No description available.

INSERT INTO entra_id.directory.subscriptions (
id,
commerceSubscriptionId,
createdDateTime,
isTrial,
nextLifecycleDateTime,
ownerId,
ownerTenantId,
ownerType,
serviceStatus,
skuId,
skuPartNumber,
status,
totalLicenses
)
SELECT
'{{ id }}',
'{{ commerceSubscriptionId }}',
'{{ createdDateTime }}',
{{ isTrial }},
'{{ nextLifecycleDateTime }}',
'{{ ownerId }}',
'{{ ownerTenantId }}',
'{{ ownerType }}',
'{{ serviceStatus }}',
'{{ skuId }}',
'{{ skuPartNumber }}',
'{{ status }}',
{{ totalLicenses }}
RETURNING
id,
commerceSubscriptionId,
createdDateTime,
isTrial,
nextLifecycleDateTime,
ownerId,
ownerTenantId,
ownerType,
serviceStatus,
skuId,
skuPartNumber,
status,
totalLicenses
;

UPDATE examples

No description available.

UPDATE entra_id.directory.subscriptions
SET
id = '{{ id }}',
commerceSubscriptionId = '{{ commerceSubscriptionId }}',
createdDateTime = '{{ createdDateTime }}',
isTrial = {{ isTrial }},
nextLifecycleDateTime = '{{ nextLifecycleDateTime }}',
ownerId = '{{ ownerId }}',
ownerTenantId = '{{ ownerTenantId }}',
ownerType = '{{ ownerType }}',
serviceStatus = '{{ serviceStatus }}',
skuId = '{{ skuId }}',
skuPartNumber = '{{ skuPartNumber }}',
status = '{{ status }}',
totalLicenses = {{ totalLicenses }}
WHERE
commerce_subscription_id = '{{ commerce_subscription_id }}' --required
RETURNING
id,
commerceSubscriptionId,
createdDateTime,
isTrial,
nextLifecycleDateTime,
ownerId,
ownerTenantId,
ownerType,
serviceStatus,
skuId,
skuPartNumber,
status,
totalLicenses;

DELETE examples

No description available.

DELETE FROM entra_id.directory.subscriptions
WHERE commerce_subscription_id = '{{ commerce_subscription_id }}' --required
AND If-Match = '{{ If-Match }}'
;