Skip to main content

billing_subscriptions

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

Overview

Namebilling_subscriptions
TypeResource
Idazure.billing.billing_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.
autoRenewstringIndicates whether auto renewal is turned on or off for a product. Known values are: "Off" and "On". (Off, On)
beneficiaryobjectThe beneficiary of the billing subscription.
beneficiaryTenantIdstringThe provisioning tenant of the subscription.
billingFrequencystringThe billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y.
billingPoliciesobjectDictionary of billing policies associated with the subscription.
billingProfileDisplayNamestringThe name of the billing profile.
billingProfileIdstringThe fully qualified ID that uniquely identifies a billing profile.
billingProfileNamestringThe ID that uniquely identifies a billing profile.
consumptionCostCenterstringThe cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement Type billing accounts.
customerDisplayNamestringThe name of the customer.
customerIdstringThe fully qualified ID that uniquely identifies a customer.
customerNamestringThe ID that uniquely identifies a customer.
displayNamestringThe name of the billing subscription.
enrollmentAccountDisplayNamestringThe enrollment Account name associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts.
enrollmentAccountIdstringThe enrollment Account ID associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts.
enrollmentAccountSubscriptionDetailsobjectEnrollment Account Subscription details. This field is available only for the Enterprise Agreement Type billing accounts.
invoiceSectionDisplayNamestringThe name of the invoice section.
invoiceSectionIdstringThe fully qualified ID that uniquely identifies an invoice section.
invoiceSectionNamestringThe ID that uniquely identifies an invoice section.
lastMonthChargesobjectThe last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts.
monthToDateChargesobjectThe current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts.
nextBillingCycleDetailsobjectNext billing cycle details of the subscription.
offerIdstringThe offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing accounts or billing accounts with agreement type Enterprise Agreement.
operationStatusstringThe status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the default value and you may need to refer to the latest API version for more details. Known values are: "Other", "None", and "LockedForUpdate". (Other, None, LockedForUpdate)
productCategorystringThe category of the product for which the subscription is purchased. Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other.
productTypestringType of the product for which the subscription is purchased.
productTypeIdstringId of the product for which the subscription is purchased.
provisioningStatestringThe provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired)
provisioningTenantIdstringThe tenant in which the subscription is provisioned.
purchaseDatestring (date-time)Purchase date of the product in UTC time.
quantityintegerThe quantity of licenses or fulfillment units for the subscription.
renewalTermDetailsobjectDetails for the next renewal term of a subscription.
resellerobjectReseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts.
resourceUristringUnique identifier of the linked resource.
skuDescriptionstringThe SKU description of the product for which the subscription is purchased. This field is is only available for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement.
skuIdstringThe SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer Agreement billing accounts.
statusstringThe status of the subscription. This field is not available for Enterprise Agreement billing accounts. Known values are: "Other", "Unknown", "Active", "Disabled", "Deleted", "Warned", "Expiring", "Expired", "AutoRenew", "Cancelled", "Suspended", and "Failed". (Other, Unknown, Active, Disabled, Deleted, Warned, Expiring, Expired, AutoRenew, Cancelled, Suspended, Failed)
subscriptionIdstringThe ID of the subscription.
suspensionReasonDetailsarrayThe suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts.
suspensionReasonsarrayThe suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
systemOverridesobjectSystem imposed policies that regulate behavior of the subscription.
tagsobjectDictionary 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 < > % & \ ? /.
termDurationstringThe duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y.
termEndDatestring (date-time)End date of the term in UTC time.
termStartDatestring (date-time)Start date of the term in UTC time.
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
list_by_customerselectbilling_account_name, billing_profile_name, customer_nameincludeDeleted, expand, filter, orderBy, top, skip, count, searchLists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
list_by_invoice_sectionselectbilling_account_name, billing_profile_name, invoice_section_nameincludeDeleted, expand, filter, orderBy, top, skip, count, searchLists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
get_by_billing_profileselectbilling_account_name, billing_profile_name, billing_subscription_nameexpandGets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement.
getselectbilling_account_name, billing_subscription_nameexpandGets 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_billing_profileselectbilling_account_name, billing_profile_nameincludeDeleted, expand, filter, orderBy, top, skip, count, searchLists 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.
list_by_customer_at_billing_accountselectbilling_account_name, customer_nameincludeDeleted, expand, filter, orderBy, top, skip, count, searchLists 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_accountselectbilling_account_name, enrollment_account_namefilter, orderBy, top, skip, count, searchLists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement.
list_by_billing_accountselectbilling_account_nameincludeDeleted, includeTenantSubscriptions, includeFailed, expand, filter, orderBy, top, skip, count, searchLists the subscriptions for a billing account.
updateupdatebilling_account_name, billing_subscription_nameUpdates the properties of a billing subscription.
deletedeletebilling_account_name, billing_subscription_nameCancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement.
cancelexecbilling_account_name, billing_subscription_name, cancellationReasonCancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement.
mergeexecbilling_account_name, billing_subscription_nameMerges the billing subscription provided in the request with a target billing subscription.
moveexecbilling_account_name, billing_subscription_nameMoves 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.
splitexecbilling_account_name, billing_subscription_nameSplits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0.
validate_move_eligibilityexecbilling_account_name, billing_subscription_nameValidates 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.

NameDatatypeDescription
billing_account_namestringThe ID that uniquely identifies a billing account. Required.
billing_profile_namestringThe ID that uniquely identifies a billing profile. Required.
billing_subscription_namestringThe ID that uniquely identifies a subscription. Required.
customer_namestringThe ID that uniquely identifies a customer. Required.
enrollment_account_namestringThe name of the enrollment account. Required.
invoice_section_namestringThe ID that uniquely identifies an invoice section. Required.
countbooleanThe count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.
expandstringCan be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.
includeDeletedbooleanCan be used to get deleted billing subscriptions. Default value is False.
includeFailedbooleanCan be used to get failed billing subscriptions. Default value is False.
includeTenantSubscriptionsbooleanCan be used to get tenant-owned billing subscriptions. This field is only applies to Microsoft Online Services Program billing accounts. Default value is False.
orderBystringThe orderby query option allows clients to request resources in a particular order. Default value is None.
skipintegerThe skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. Default value is None.
topintegerThe 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. Default value is None.

SELECT examples

Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

SELECT
id,
name,
autoRenew,
beneficiary,
beneficiaryTenantId,
billingFrequency,
billingPolicies,
billingProfileDisplayName,
billingProfileId,
billingProfileName,
consumptionCostCenter,
customerDisplayName,
customerId,
customerName,
displayName,
enrollmentAccountDisplayName,
enrollmentAccountId,
enrollmentAccountSubscriptionDetails,
invoiceSectionDisplayName,
invoiceSectionId,
invoiceSectionName,
lastMonthCharges,
monthToDateCharges,
nextBillingCycleDetails,
offerId,
operationStatus,
productCategory,
productType,
productTypeId,
provisioningState,
provisioningTenantId,
purchaseDate,
quantity,
renewalTermDetails,
reseller,
resourceUri,
skuDescription,
skuId,
status,
subscriptionId,
suspensionReasonDetails,
suspensionReasons,
systemData,
systemOverrides,
tags,
termDuration,
termEndDate,
termStartDate,
type
FROM azure.billing.billing_subscriptions
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND customer_name = '{{ customer_name }}' -- 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 }}'
;

UPDATE examples

Updates the properties of a billing subscription.

UPDATE azure.billing.billing_subscriptions
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND billing_subscription_name = '{{ billing_subscription_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;

DELETE examples

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.billing_subscriptions
WHERE billing_account_name = '{{ billing_account_name }}' --required
AND billing_subscription_name = '{{ billing_subscription_name }}' --required
;

Lifecycle Methods

Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement.

EXEC azure.billing.billing_subscriptions.cancel 
@billing_account_name='{{ billing_account_name }}' --required,
@billing_subscription_name='{{ billing_subscription_name }}' --required
@@json=
'{
"cancellationReason": "{{ cancellationReason }}",
"customerId": "{{ customerId }}"
}'
;