Skip to main content

accounts

Creates, updates, deletes, gets or lists an accounts resource.

Overview

Nameaccounts
TypeResource
Idazure.billing.accounts

Fields

The following fields are returned by SELECT queries:

A billing account.

NameDatatypeDescription
propertiesobjectA billing account.
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 < > % & \ ? /

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbillingAccountNameGets a billing account by its ID.
listselectincludeAll, includeAllWithoutBillingProfiles, includeDeleted, includePendingAgreement, includeResellee, legalOwnerTID, legalOwnerOID, filter, expand, top, skip, searchLists the billing accounts that a user has access to.
updateupdatebillingAccountNameUpdates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement.
add_payment_termsexecbillingAccountNameAdds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action.
cancel_payment_termsexecbillingAccountNameCancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action.
confirm_transitionexecbillingAccountNameGets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement.
validate_payment_termsexecbillingAccountNameValidates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'.

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
billingAccountNamestringThe ID that uniquely identifies a billing account.
expandstringExpand is allowed for SoldTo and EnrollmentDetails/PONumber.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL.
includeAllbooleanWhen true, results will include Billing Accounts that the user does not have a direct role assignment on if the user has one of the following AAD roles: Global Administrator, Global Reader, Billing Administrator.
includeAllWithoutBillingProfilesbooleanWhen true, results will include Billing Accounts that are not fully created if the user has one of the following AAD roles: Global Administrator, Global Reader, Billing Administrator.
includeDeletedbooleanWhen true, results will include any billing accounts in a deleted state.
includePendingAgreementbooleanIncludes billing accounts with agreement pending signature that the user has access to.
includeReselleebooleanIncludes the customer's billing account of Microsoft Partner Agreement that the user has access to.
legalOwnerOIDstringMust be combined with legalOwnerTID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional.
legalOwnerTIDstringMust be combined with legalOwnerOID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional.
skipinteger (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.
topinteger (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

Gets a billing account by its ID.

SELECT
properties,
tags
FROM azure.billing.accounts
WHERE billingAccountName = '{{ billingAccountName }}' -- required
;

UPDATE examples

Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement.

UPDATE azure.billing.accounts
SET
data__tags = '{{ tags }}',
data__properties = '{{ properties }}'
WHERE
billingAccountName = '{{ billingAccountName }}' --required
RETURNING
properties,
tags;

Lifecycle Methods

Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action.

EXEC azure.billing.accounts.add_payment_terms 
@billingAccountName='{{ billingAccountName }}' --required
;