Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idazure_stack.subscriptions_admin.subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified identifier.
delegatedProviderSubscriptionIdstringParent DelegatedProvider subscription identifier.
displayNamestringSubscription name.
externalReferenceIdstringExternal reference identifier.
offerIdstringIdentifier of the offer under the scope of a delegated provider.
ownerstringSubscription owner.
routingResourceManagerTypestringRouting resource manager type.
statestringSubscription state.
subscriptionIdstringSubscription identifier.
tenantIdstringDirectory tenant identifier.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, targetSubscriptionIdGet a specified subscription.
listselectsubscriptionId$filterGet the list of subscriptions.
create_or_updateinsertsubscriptionId, targetSubscriptionIdCreates or updates the specified subscription.
deletedeletesubscriptionId, targetSubscriptionIdDelete the specified subscription.
restore_dataexecsubscriptionIdRestores the data
check_identity_healthexecsubscriptionIdChecks the identity health
move_subscriptionsexecsubscriptionId, resourcesMove subscriptions between delegated provider offers.
validate_move_subscriptionsexecsubscriptionId, resourcesValidate that user subscriptions can be moved between delegated provider offers.
check_name_availabilityexecsubscriptionIdGet the list of subscriptions.

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
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription.The subscription ID forms part of the URI for every service call.
targetSubscriptionIdstringThe target subscription ID.
$filterstringOData filter parameter.

SELECT examples

Get a specified subscription.

SELECT
id,
delegatedProviderSubscriptionId,
displayName,
externalReferenceId,
offerId,
owner,
routingResourceManagerType,
state,
subscriptionId,
tenantId
FROM azure_stack.subscriptions_admin.subscriptions
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND targetSubscriptionId = '{{ targetSubscriptionId }}' -- required
;

INSERT examples

Creates or updates the specified subscription.

INSERT INTO azure_stack.subscriptions_admin.subscriptions (
data__delegatedProviderSubscriptionId,
data__displayName,
data__id,
data__externalReferenceId,
data__offerId,
data__owner,
data__routingResourceManagerType,
data__state,
data__subscriptionId,
data__tenantId,
subscriptionId,
targetSubscriptionId
)
SELECT
'{{ delegatedProviderSubscriptionId }}',
'{{ displayName }}',
'{{ id }}',
'{{ externalReferenceId }}',
'{{ offerId }}',
'{{ owner }}',
'{{ routingResourceManagerType }}',
'{{ state }}',
'{{ subscriptionId }}',
'{{ tenantId }}',
'{{ subscriptionId }}',
'{{ targetSubscriptionId }}'
RETURNING
id,
delegatedProviderSubscriptionId,
displayName,
externalReferenceId,
offerId,
owner,
routingResourceManagerType,
state,
subscriptionId,
tenantId
;

DELETE examples

Delete the specified subscription.

DELETE FROM azure_stack.subscriptions_admin.subscriptions
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND targetSubscriptionId = '{{ targetSubscriptionId }}' --required
;

Lifecycle Methods

Restores the data

EXEC azure_stack.subscriptions_admin.subscriptions.restore_data 
@subscriptionId='{{ subscriptionId }}' --required
;