BillingSubscriptionsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

BillingManagementClient's

<xref:billing_subscriptions> attribute.

Inheritance
builtins.object
BillingSubscriptionsOperations

Constructor

BillingSubscriptionsOperations(*args, **kwargs)

Methods

begin_cancel

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

begin_delete

Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement.

begin_merge

Merges the billing subscription provided in the request with a target billing subscription.

begin_move

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.

begin_split

Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0.

begin_update

Updates the properties of a billing subscription.

get

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.

get_by_billing_profile

Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement.

list_by_billing_account

Lists the subscriptions for a billing account.

list_by_billing_profile

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.

list_by_customer

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

list_by_customer_at_billing_account

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

Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement.

list_by_invoice_section

Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

validate_move_eligibility

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.

begin_cancel

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

async begin_cancel(billing_account_name: str, billing_subscription_name: str, parameters: _models.CancelSubscriptionRequest, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

parameters
Required

Request parameters for cancel customer subscription. Is either a CancelSubscriptionRequest type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description
See also

begin_delete

Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement.

async begin_delete(billing_account_name: str, billing_subscription_name: str, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description
See also

begin_merge

Merges the billing subscription provided in the request with a target billing subscription.

async begin_merge(billing_account_name: str, billing_subscription_name: str, parameters: _models.BillingSubscriptionMergeRequest, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

parameters
Required

Request parameters that are provided to merge the two billing subscriptions. Is either a BillingSubscriptionMergeRequest type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

begin_move

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.

async begin_move(billing_account_name: str, billing_subscription_name: str, parameters: _models.MoveBillingSubscriptionRequest, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

parameters
Required

Request parameters to transfer billing subscription. Is either a MoveBillingSubscriptionRequest type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

begin_split

Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0.

async begin_split(billing_account_name: str, billing_subscription_name: str, parameters: _models.BillingSubscriptionSplitRequest, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

parameters
Required

Request parameters that are provided to split the billing subscription. Is either a BillingSubscriptionSplitRequest type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

begin_update

Updates the properties of a billing subscription.

async begin_update(billing_account_name: str, billing_subscription_name: str, parameters: _models.BillingSubscriptionPatch, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

parameters
Required

The billing properties of a subscription. Is either a BillingSubscriptionPatch type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

get

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.

async get(billing_account_name: str, billing_subscription_name: str, expand: str | None = None, **kwargs: Any) -> BillingSubscription

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

Returns

Type Description

BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

get_by_billing_profile

Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement.

async get_by_billing_profile(billing_account_name: str, billing_profile_name: str, billing_subscription_name: str, expand: str | None = None, **kwargs: Any) -> BillingSubscription

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

Returns

Type Description

BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

list_by_billing_account

Lists the subscriptions for a billing account.

list_by_billing_account(billing_account_name: str, include_deleted: bool = False, include_tenant_subscriptions: bool = False, include_failed: bool = False, expand: str | None = None, filter: str | None = None, order_by: str | None = None, top: int | None = None, skip: int | None = None, count: bool | None = None, search: str | None = None, **kwargs: Any) -> AsyncIterable[BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

include_deleted
Required

Can be used to get deleted billing subscriptions. Default value is False.

include_tenant_subscriptions
Required

Can be used to get tenant-owned billing subscriptions. This field is only applies to Microsoft Online Services Program billing accounts. Default value is False.

include_failed
Required

Can be used to get failed billing subscriptions. Default value is False.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

filter
Required
str

The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.

order_by
Required
str

The orderby query option allows clients to request resources in a particular order. Default value is None.

top
Required
int

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. Default value is None.

skip
Required
int

The 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.

count
Required

The count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.

search
Required
str

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. Default value is None.

Returns

Type Description

An iterator like instance of either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

list_by_billing_profile

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.

list_by_billing_profile(billing_account_name: str, billing_profile_name: str, include_deleted: bool = False, expand: str | None = None, filter: str | None = None, order_by: str | None = None, top: int | None = None, skip: int | None = None, count: bool | None = None, search: str | None = None, **kwargs: Any) -> AsyncIterable[BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

include_deleted
Required

Can be used to get deleted billing subscriptions. Default value is False.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

filter
Required
str

The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.

order_by
Required
str

The orderby query option allows clients to request resources in a particular order. Default value is None.

top
Required
int

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. Default value is None.

skip
Required
int

The 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.

count
Required

The count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.

search
Required
str

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. Default value is None.

Returns

Type Description

An iterator like instance of either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

list_by_customer

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

list_by_customer(billing_account_name: str, billing_profile_name: str, customer_name: str, include_deleted: bool = False, expand: str | None = None, filter: str | None = None, order_by: str | None = None, top: int | None = None, skip: int | None = None, count: bool | None = None, search: str | None = None, **kwargs: Any) -> AsyncIterable[BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

customer_name
Required
str

The ID that uniquely identifies a customer. Required.

include_deleted
Required

Can be used to get deleted billing subscriptions. Default value is False.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

filter
Required
str

The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.

order_by
Required
str

The orderby query option allows clients to request resources in a particular order. Default value is None.

top
Required
int

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. Default value is None.

skip
Required
int

The 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.

count
Required

The count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.

search
Required
str

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. Default value is None.

Returns

Type Description

An iterator like instance of either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

list_by_customer_at_billing_account

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_customer_at_billing_account(billing_account_name: str, customer_name: str, include_deleted: bool = False, expand: str | None = None, filter: str | None = None, order_by: str | None = None, top: int | None = None, skip: int | None = None, count: bool | None = None, search: str | None = None, **kwargs: Any) -> AsyncIterable[BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

customer_name
Required
str

The ID that uniquely identifies a customer. Required.

include_deleted
Required

Can be used to get deleted billing subscriptions. Default value is False.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

filter
Required
str

The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.

order_by
Required
str

The orderby query option allows clients to request resources in a particular order. Default value is None.

top
Required
int

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. Default value is None.

skip
Required
int

The 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.

count
Required

The count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.

search
Required
str

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. Default value is None.

Returns

Type Description

An iterator like instance of either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

list_by_enrollment_account

Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement.

list_by_enrollment_account(billing_account_name: str, enrollment_account_name: str, filter: str | None = None, order_by: str | None = None, top: int | None = None, skip: int | None = None, count: bool | None = None, search: str | None = None, **kwargs: Any) -> AsyncIterable[BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

enrollment_account_name
Required
str

The name of the enrollment account. Required.

filter
Required
str

The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.

order_by
Required
str

The orderby query option allows clients to request resources in a particular order. Default value is None.

top
Required
int

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. Default value is None.

skip
Required
int

The 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.

count
Required

The count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.

search
Required
str

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. Default value is None.

Returns

Type Description

An iterator like instance of either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

list_by_invoice_section

Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

list_by_invoice_section(billing_account_name: str, billing_profile_name: str, invoice_section_name: str, include_deleted: bool = False, expand: str | None = None, filter: str | None = None, order_by: str | None = None, top: int | None = None, skip: int | None = None, count: bool | None = None, search: str | None = None, **kwargs: Any) -> AsyncIterable[BillingSubscription]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

invoice_section_name
Required
str

The ID that uniquely identifies an invoice section. Required.

include_deleted
Required

Can be used to get deleted billing subscriptions. Default value is False.

expand
Required
str

Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges. Default value is None.

filter
Required
str

The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.

order_by
Required
str

The orderby query option allows clients to request resources in a particular order. Default value is None.

top
Required
int

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. Default value is None.

skip
Required
int

The 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.

count
Required

The count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.

search
Required
str

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. Default value is None.

Returns

Type Description

An iterator like instance of either BillingSubscription or the result of cls(response)

Exceptions

Type Description
See also

validate_move_eligibility

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.

async validate_move_eligibility(billing_account_name: str, billing_subscription_name: str, parameters: _models.MoveBillingSubscriptionRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.MoveBillingSubscriptionEligibilityResult

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_subscription_name
Required
str

The ID that uniquely identifies a subscription. Required.

parameters
Required

Request parameters to transfer billing subscription. Is either a MoveBillingSubscriptionRequest type or a IO[bytes] type. Required.

Returns

Type Description

MoveBillingSubscriptionEligibilityResult or the result of cls(response)

Exceptions

Type Description
See also

Attributes

models

models = <module 'azure.mgmt.billing.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\billing\\models\\__init__.py'>