Skip to main content

management_group_subscriptions

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

Overview

Namemanagement_group_subscriptions
TypeResource
Idazure.management_groups.management_group_subscriptions

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.
displayNamestringThe friendly name of the subscription.
parentobjectThe ID of the parent management group.
statestringThe state of the subscription.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tenantstringThe AAD Tenant ID associated with the subscription. For example, 00000000-0000-0000-0000-000000000000.
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
get_subscriptionselectgroup_id, subscription_idCache-ControlRetrieves details about given subscription which is associated with the management group.
get_subscriptions_under_management_groupselectgroup_id$skiptokenRetrieves details about all subscriptions which are associated with the management group.
createinsertgroup_id, subscription_idCache-ControlAssociates existing subscription with the management group.
deletedeletegroup_id, subscription_idCache-ControlDe-associates subscription from the management group.

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
group_idstringManagement Group ID. Required.
subscription_idstringSubscription ID. Required.
$skiptokenstringPage continuation token is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls. Default value is None.
Cache-ControlstringIndicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches. Default value is "no-cache".

SELECT examples

Retrieves details about given subscription which is associated with the management group.

SELECT
id,
name,
displayName,
parent,
state,
systemData,
tenant,
type
FROM azure.management_groups.management_group_subscriptions
WHERE group_id = '{{ group_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND Cache-Control = '{{ Cache-Control }}'
;

INSERT examples

Associates existing subscription with the management group.

INSERT INTO azure.management_groups.management_group_subscriptions (
group_id,
subscription_id,
Cache-Control
)
SELECT
'{{ group_id }}',
'{{ subscription_id }}',
'{{ Cache-Control }}'
RETURNING
id,
name,
properties,
systemData,
type
;

DELETE examples

De-associates subscription from the management group.

DELETE FROM azure.management_groups.management_group_subscriptions
WHERE group_id = '{{ group_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND Cache-Control = '{{ Cache-Control }}'
;