billing_accounts
Creates, updates, deletes, gets or lists a billing_accounts resource.
Overview
| Name | billing_accounts |
| Type | Resource |
| Id | azure.billing.billing_accounts |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
accountStatus | string | The 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) |
accountStatusReasonCode | string | Reason for the specified billing account status. Known values are: "Other", "UnusualActivity", "ManuallyTerminated", "Expired", "Transferred", and "TerminateProcessing". (Other, UnusualActivity, ManuallyTerminated, Expired, Transferred, TerminateProcessing) |
accountSubType | string | The tier of the account. Known values are: "Other", "None", "Individual", "Professional", and "Enterprise". (Other, None, Individual, Professional, Enterprise) |
accountType | string | The 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) |
agreementType | string | The type of agreement. Known values are: "Other", "MicrosoftCustomerAgreement", "EnterpriseAgreement", "MicrosoftOnlineServicesProgram", and "MicrosoftPartnerAgreement". (Other, MicrosoftCustomerAgreement, EnterpriseAgreement, MicrosoftOnlineServicesProgram, MicrosoftPartnerAgreement) |
billingRelationshipTypes | array | Identifies the billing relationships represented by a billing account. The billing relationship may be between Microsoft, the customer, and/or a third-party. |
displayName | string | The billing account name. |
enrollmentDetails | object | The properties of an enrollment. |
hasNoBillingProfiles | boolean | Indicates whether or not the billing account has any billing profiles. |
hasReadAccess | boolean | Indicates whether user has read access to the billing account. |
notificationEmailAddress | string | Notification email address for legacy account. Available for agreement type Microsoft Online Services Program. |
primaryBillingTenantId | string | The 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. |
provisioningState | string | The 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) |
qualifications | array | Qualifications for pricing on a billing account. Values may be Commercial, Education, Charity or Government. |
registrationNumber | object | Describes the registration number of the organization linked with the billing account. |
soldTo | object | The address of the individual or organization that is responsible for the billing account. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
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 < > % & \ ? /. |
taxIds | array | A list of tax identifiers for the billing account. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
accountStatus | string | The 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) |
accountStatusReasonCode | string | Reason for the specified billing account status. Known values are: "Other", "UnusualActivity", "ManuallyTerminated", "Expired", "Transferred", and "TerminateProcessing". (Other, UnusualActivity, ManuallyTerminated, Expired, Transferred, TerminateProcessing) |
accountSubType | string | The tier of the account. Known values are: "Other", "None", "Individual", "Professional", and "Enterprise". (Other, None, Individual, Professional, Enterprise) |
accountType | string | The 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) |
agreementType | string | The type of agreement. Known values are: "Other", "MicrosoftCustomerAgreement", "EnterpriseAgreement", "MicrosoftOnlineServicesProgram", and "MicrosoftPartnerAgreement". (Other, MicrosoftCustomerAgreement, EnterpriseAgreement, MicrosoftOnlineServicesProgram, MicrosoftPartnerAgreement) |
billingRelationshipTypes | array | Identifies the billing relationships represented by a billing account. The billing relationship may be between Microsoft, the customer, and/or a third-party. |
displayName | string | The billing account name. |
enrollmentDetails | object | The properties of an enrollment. |
hasNoBillingProfiles | boolean | Indicates whether or not the billing account has any billing profiles. |
hasReadAccess | boolean | Indicates whether user has read access to the billing account. |
notificationEmailAddress | string | Notification email address for legacy account. Available for agreement type Microsoft Online Services Program. |
primaryBillingTenantId | string | The 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. |
provisioningState | string | The 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) |
qualifications | array | Qualifications for pricing on a billing account. Values may be Commercial, Education, Charity or Government. |
registrationNumber | object | Describes the registration number of the organization linked with the billing account. |
soldTo | object | The address of the individual or organization that is responsible for the billing account. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
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 < > % & \ ? /. |
taxIds | array | A list of tax identifiers for the billing account. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | billing_account_name | Gets a billing account by its ID. | |
list | select | includeAll, includeAllWithoutBillingProfiles, includeDeleted, includePendingAgreement, includeResellee, legalOwnerTID, legalOwnerOID, filter, expand, top, skip, search | Lists the billing accounts that a user has access to. | |
update | update | billing_account_name | 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. | |
list_invoice_sections_by_create_subscription_permission | exec | billing_account_name | filter | 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. |
add_payment_terms | exec | billing_account_name | 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. | |
cancel_payment_terms | exec | billing_account_name | Cancels 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_transition | exec | billing_account_name | Gets 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_terms | exec | billing_account_name | Validates 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.
| Name | Datatype | Description |
|---|---|---|
billing_account_name | string | The ID that uniquely identifies a billing account. Required. |
expand | string | Expand is allowed for SoldTo and EnrollmentDetails/PONumber. Default value is None. |
filter | string | The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None. |
includeAll | boolean | When 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. |
includeAllWithoutBillingProfiles | boolean | When 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. |
includeDeleted | boolean | When true, results will include any billing accounts in a deleted state. Default value is False. |
includePendingAgreement | boolean | Includes billing accounts with agreement pending signature that the user has access to. Default value is False. |
includeResellee | boolean | Includes the customer's billing account of Microsoft Partner Agreement that the user has access to. Default value is False. |
legalOwnerOID | string | Must be combined with legalOwnerTID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional. Default value is None. |
legalOwnerTID | string | Must be combined with legalOwnerOID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional. Default value is None. |
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. Default value is None. |
skip | integer | 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. |
top | integer | 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. |
SELECT examples
- get
- list
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
;
Lists the billing accounts that a user has access to.
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 includeAll = '{{ includeAll }}'
AND includeAllWithoutBillingProfiles = '{{ includeAllWithoutBillingProfiles }}'
AND includeDeleted = '{{ includeDeleted }}'
AND includePendingAgreement = '{{ includePendingAgreement }}'
AND includeResellee = '{{ includeResellee }}'
AND legalOwnerTID = '{{ legalOwnerTID }}'
AND legalOwnerOID = '{{ legalOwnerOID }}'
AND filter = '{{ filter }}'
AND expand = '{{ expand }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND search = '{{ search }}'
;
UPDATE examples
- update
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
- list_invoice_sections_by_create_subscription_permission
- add_payment_terms
- cancel_payment_terms
- confirm_transition
- validate_payment_terms
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 }}'
;
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.billing_accounts.add_payment_terms
@billing_account_name='{{ billing_account_name }}' --required
@@json=
'{
"term": "{{ term }}",
"startDate": "{{ startDate }}",
"endDate": "{{ endDate }}"
}'
;
Cancels 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.
EXEC azure.billing.billing_accounts.cancel_payment_terms
@billing_account_name='{{ billing_account_name }}' --required
;
Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement.
EXEC azure.billing.billing_accounts.confirm_transition
@billing_account_name='{{ billing_account_name }}' --required
;
Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'.
EXEC azure.billing.billing_accounts.validate_payment_terms
@billing_account_name='{{ billing_account_name }}' --required
@@json=
'{
"term": "{{ term }}",
"startDate": "{{ startDate }}",
"endDate": "{{ endDate }}"
}'
;