Skip to main content

billing_accounts

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

Overview

Namebilling_accounts
TypeResource
Idazure.billing.billing_accounts

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.
accountStatusstringThe current status of the billing account. Known values are: "Other", "Active", "UnderReview", "Disabled", "Deleted", "Extended", "Pending", "New", "Expired", "Terminated", and "Transferred". (Other, Active, UnderReview, Disabled, Deleted, Extended, Pending, New, Expired, Terminated, Transferred)
accountStatusReasonCodestringReason for the specified billing account status. Known values are: "Other", "UnusualActivity", "ManuallyTerminated", "Expired", "Transferred", and "TerminateProcessing". (Other, UnusualActivity, ManuallyTerminated, Expired, Transferred, TerminateProcessing)
accountSubTypestringThe tier of the account. Known values are: "Other", "None", "Individual", "Professional", and "Enterprise". (Other, None, Individual, Professional, Enterprise)
accountTypestringThe type of customer. Known values are: "Other", "Enterprise", "Individual", "Partner", "Reseller", "ClassicPartner", "Internal", "Tenant", and "Business". (Other, Enterprise, Individual, Partner, Reseller, ClassicPartner, Internal, Tenant, Business)
agreementTypestringThe type of agreement. Known values are: "Other", "MicrosoftCustomerAgreement", "EnterpriseAgreement", "MicrosoftOnlineServicesProgram", and "MicrosoftPartnerAgreement". (Other, MicrosoftCustomerAgreement, EnterpriseAgreement, MicrosoftOnlineServicesProgram, MicrosoftPartnerAgreement)
billingRelationshipTypesarrayIdentifies the billing relationships represented by a billing account. The billing relationship may be between Microsoft, the customer, and/or a third-party.
displayNamestringThe billing account name.
enrollmentDetailsobjectThe properties of an enrollment.
hasNoBillingProfilesbooleanIndicates whether or not the billing account has any billing profiles.
hasReadAccessbooleanIndicates whether user has read access to the billing account.
notificationEmailAddressstringNotification email address for legacy account. Available for agreement type Microsoft Online Services Program.
primaryBillingTenantIdstringThe tenant that was used to set up the billing account. By default, only users from this tenant can get role assignments on the billing account and all purchases are provisioned in this tenant.
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)
qualificationsarrayQualifications for pricing on a billing account. Values may be Commercial, Education, Charity or Government.
registrationNumberobjectDescribes the registration number of the organization linked with the billing account.
soldToobjectThe address of the individual or organization that is responsible for the billing account.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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 < > % & \ ? /.
taxIdsarrayA list of tax identifiers for the billing account.
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
getselectbilling_account_nameGets 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.
updateupdatebilling_account_nameUpdates 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.
list_invoice_sections_by_create_subscription_permissionexecbilling_account_namefilterLists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
add_payment_termsexecbilling_account_nameAdds 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_termsexecbilling_account_nameCancels 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_transitionexecbilling_account_nameGets 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_termsexecbilling_account_nameValidates 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
billing_account_namestringThe ID that uniquely identifies a billing account. Required.
expandstringExpand is allowed for SoldTo and EnrollmentDetails/PONumber. 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.
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. Default value is False.
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. Default value is False.
includeDeletedbooleanWhen true, results will include any billing accounts in a deleted state. Default value is False.
includePendingAgreementbooleanIncludes billing accounts with agreement pending signature that the user has access to. Default value is False.
includeReselleebooleanIncludes the customer's billing account of Microsoft Partner Agreement that the user has access to. Default value is False.
legalOwnerOIDstringMust be combined with legalOwnerTID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional. Default value is None.
legalOwnerTIDstringMust be combined with legalOwnerOID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional. 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

Gets a billing account by its ID.

SELECT
id,
name,
accountStatus,
accountStatusReasonCode,
accountSubType,
accountType,
agreementType,
billingRelationshipTypes,
displayName,
enrollmentDetails,
hasNoBillingProfiles,
hasReadAccess,
notificationEmailAddress,
primaryBillingTenantId,
provisioningState,
qualifications,
registrationNumber,
soldTo,
systemData,
tags,
taxIds,
type
FROM azure.billing.billing_accounts
WHERE billing_account_name = '{{ billing_account_name }}' -- 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.billing_accounts
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;

Lifecycle Methods

Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

EXEC azure.billing.billing_accounts.list_invoice_sections_by_create_subscription_permission 
@billing_account_name='{{ billing_account_name }}' --required,
@filter='{{ filter }}'
;