Skip to main content

invoice_sections

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

Overview

Nameinvoice_sections
TypeResource
Idazure.billing.invoice_sections

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.
displayNamestringThe name of the invoice section.
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)
reasonCodestringReason for the specified invoice section status. Known values are: "Other", "PastDue", "UnusualActivity", "SpendingLimitReached", and "SpendingLimitExpired". (Other, PastDue, UnusualActivity, SpendingLimitReached, SpendingLimitExpired)
statestringIdentifies the status of an invoice section. Known values are: "Other", "Active", "Deleted", "Disabled", "UnderReview", "Warned", and "Restricted". (Other, Active, Deleted, Disabled, UnderReview, Warned, Restricted)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
systemIdstringThe system generated unique identifier for an invoice section.
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 < > % & \ ? /.
targetCloudstringIdentifies the cloud environments that are associated with an invoice section. This is a system managed optional field and gets updated as the invoice section gets associated with accounts in various clouds.
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_name, billing_profile_name, invoice_section_nameGets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
list_by_billing_profileselectbilling_account_name, billing_profile_nameincludeDeleted, filter, orderBy, top, skip, count, searchLists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
create_or_updateinsertbilling_account_name, billing_profile_name, invoice_section_nameCreates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
create_or_updatereplacebilling_account_name, billing_profile_name, invoice_section_nameCreates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
deletedeletebilling_account_name, billing_profile_name, invoice_section_nameDeletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
validate_delete_eligibilityexecbilling_account_name, billing_profile_name, invoice_section_nameValidates if the invoice section can be deleted. The 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.
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.
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 invoice sections. 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

Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

SELECT
id,
name,
displayName,
provisioningState,
reasonCode,
state,
systemData,
systemId,
tags,
targetCloud,
type
FROM azure.billing.invoice_sections
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND invoice_section_name = '{{ invoice_section_name }}' -- required
;

INSERT examples

Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

INSERT INTO azure.billing.invoice_sections (
properties,
tags,
billing_account_name,
billing_profile_name,
invoice_section_name
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ billing_account_name }}',
'{{ billing_profile_name }}',
'{{ invoice_section_name }}'
RETURNING
id,
name,
properties,
systemData,
tags,
type
;

REPLACE examples

Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

REPLACE azure.billing.invoice_sections
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
AND invoice_section_name = '{{ invoice_section_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;

DELETE examples

Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.

DELETE FROM azure.billing.invoice_sections
WHERE billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
AND invoice_section_name = '{{ invoice_section_name }}' --required
;

Lifecycle Methods

Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.

EXEC azure.billing.invoice_sections.validate_delete_eligibility 
@billing_account_name='{{ billing_account_name }}' --required,
@billing_profile_name='{{ billing_profile_name }}' --required,
@invoice_section_name='{{ invoice_section_name }}' --required
;