subscriptions
Creates, updates, deletes, gets or lists a subscriptions
resource.
Overview
Name | subscriptions |
Type | Resource |
Id | azure.billing.subscriptions |
Fields
The following fields are returned by SELECT
queries:
- get_by_billing_profile
- list_by_customer
- list_by_billing_profile
- get
- list_by_customer_at_billing_account
- list_by_enrollment_account
- list_by_billing_account
A billing subscription.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
The list of billing subscriptions.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
The list of billing subscriptions.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
A billing subscription.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
The list of billing subscriptions.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
The list of billing subscriptions.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
The list of billing subscriptions.
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a(n) BillingSubscription |
tags | object | Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_by_billing_profile | select | billingAccountName , billingProfileName , billingSubscriptionName | expand | Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. |
list_by_customer | select | billingAccountName , billingProfileName , customerName | includeDeleted , expand , filter , orderBy , top , skip , count , search | Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. |
list_by_billing_profile | select | billingAccountName , billingProfileName | includeDeleted , expand , filter , orderBy , top , skip , count , search | Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. |
get | select | billingAccountName , billingSubscriptionName | expand | Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. |
list_by_customer_at_billing_account | select | billingAccountName , customerName | includeDeleted , expand , filter , orderBy , top , skip , count , search | Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. |
list_by_enrollment_account | select | billingAccountName , enrollmentAccountName | filter , orderBy , top , skip , count , search | Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. |
list_by_billing_account | select | billingAccountName | includeDeleted , includeTenantSubscriptions , includeFailed , expand , filter , orderBy , top , skip , count , search | Lists the subscriptions for a billing account. |
update | update | billingAccountName , billingSubscriptionName | Updates the properties of a billing subscription. | |
delete | delete | billingAccountName , billingSubscriptionName | Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. | |
cancel | exec | billingAccountName , billingSubscriptionName , cancellationReason | Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. | |
merge | exec | billingAccountName , billingSubscriptionName | Merges the billing subscription provided in the request with a target billing subscription. | |
move | exec | billingAccountName , billingSubscriptionName | Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. | |
split | exec | billingAccountName , billingSubscriptionName | Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. | |
validate_move_eligibility | exec | billingAccountName , billingSubscriptionName | Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. |
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.
Name | Datatype | Description |
---|---|---|
billingAccountName | string | The ID that uniquely identifies a billing account. |
billingProfileName | string | The ID that uniquely identifies a billing profile. |
billingSubscriptionName | string | The ID that uniquely identifies a subscription. |
customerName | string | The ID that uniquely identifies a customer. |
enrollmentAccountName | string | The name of the enrollment account. |
count | boolean | The count query option allows clients to request a count of the matching resources included with the resources in the response. |
expand | string | Can be used to expand Reseller , ConsumptionCostCenter , LastMonthCharges and MonthToDateCharges |
filter | string | The filter query option allows clients to filter a collection of resources that are addressed by a request URL. |
includeDeleted | boolean | Can be used to get deleted billing subscriptions. |
includeFailed | boolean | Can be used to get failed billing subscriptions. |
includeTenantSubscriptions | boolean | Can be used to get tenant-owned billing subscriptions. This field is only applies to Microsoft Online Services Program billing accounts. |
orderBy | string | The orderby query option allows clients to request resources in a particular order. |
search | string | The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. |
skip | integer (int64) | The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. |
top | integer (int64) | The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. |
SELECT
examples
- get_by_billing_profile
- list_by_customer
- list_by_billing_profile
- get
- list_by_customer_at_billing_account
- list_by_enrollment_account
- list_by_billing_account
Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND billingProfileName = '{{ billingProfileName }}' -- required
AND billingSubscriptionName = '{{ billingSubscriptionName }}' -- required
AND expand = '{{ expand }}'
;
Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND billingProfileName = '{{ billingProfileName }}' -- required
AND customerName = '{{ customerName }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
AND expand = '{{ expand }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;
Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND billingProfileName = '{{ billingProfileName }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
AND expand = '{{ expand }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;
Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND billingSubscriptionName = '{{ billingSubscriptionName }}' -- required
AND expand = '{{ expand }}'
;
Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND customerName = '{{ customerName }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
AND expand = '{{ expand }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;
Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND enrollmentAccountName = '{{ enrollmentAccountName }}' -- required
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;
Lists the subscriptions for a billing account.
SELECT
properties,
tags
FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
AND includeTenantSubscriptions = '{{ includeTenantSubscriptions }}'
AND includeFailed = '{{ includeFailed }}'
AND expand = '{{ expand }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;
UPDATE
examples
- update
Updates the properties of a billing subscription.
UPDATE azure.billing.subscriptions
SET
data__tags = '{{ tags }}',
data__properties = '{{ properties }}'
WHERE
billingAccountName = '{{ billingAccountName }}' --required
AND billingSubscriptionName = '{{ billingSubscriptionName }}' --required
RETURNING
properties,
tags;
DELETE
examples
- delete
Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement.
DELETE FROM azure.billing.subscriptions
WHERE billingAccountName = '{{ billingAccountName }}' --required
AND billingSubscriptionName = '{{ billingSubscriptionName }}' --required
;
Lifecycle Methods
- cancel
- merge
- move
- split
- validate_move_eligibility
Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement.
EXEC azure.billing.subscriptions.cancel
@billingAccountName='{{ billingAccountName }}' --required,
@billingSubscriptionName='{{ billingSubscriptionName }}' --required
@@json=
'{
"cancellationReason": "{{ cancellationReason }}",
"customerId": "{{ customerId }}"
}'
;
Merges the billing subscription provided in the request with a target billing subscription.
EXEC azure.billing.subscriptions.merge
@billingAccountName='{{ billingAccountName }}' --required,
@billingSubscriptionName='{{ billingSubscriptionName }}' --required
@@json=
'{
"targetBillingSubscriptionName": "{{ targetBillingSubscriptionName }}",
"quantity": {{ quantity }}
}'
;
Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
EXEC azure.billing.subscriptions.move
@billingAccountName='{{ billingAccountName }}' --required,
@billingSubscriptionName='{{ billingSubscriptionName }}' --required
@@json=
'{
"destinationInvoiceSectionId": "{{ destinationInvoiceSectionId }}",
"destinationEnrollmentAccountId": "{{ destinationEnrollmentAccountId }}"
}'
;
Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0.
EXEC azure.billing.subscriptions.split
@billingAccountName='{{ billingAccountName }}' --required,
@billingSubscriptionName='{{ billingSubscriptionName }}' --required
@@json=
'{
"targetProductTypeId": "{{ targetProductTypeId }}",
"targetSkuId": "{{ targetSkuId }}",
"quantity": {{ quantity }},
"termDuration": "{{ termDuration }}",
"billingFrequency": "{{ billingFrequency }}"
}'
;
Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
EXEC azure.billing.subscriptions.validate_move_eligibility
@billingAccountName='{{ billingAccountName }}' --required,
@billingSubscriptionName='{{ billingSubscriptionName }}' --required
@@json=
'{
"destinationInvoiceSectionId": "{{ destinationInvoiceSectionId }}",
"destinationEnrollmentAccountId": "{{ destinationEnrollmentAccountId }}"
}'
;