Skip to main content

charges

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

Overview

Namecharges
TypeResource
Idazure.consumption.charges

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.
eTagstringeTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
kindstringSpecifies the kind of charge summary. Required. Known values are: "legacy" and "modern".
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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
listselectscopestartDate, endDate, $filter, $applyLists the charges based for the defined scope.

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
scopestringThe fully qualified Azure Resource manager identifier of the resource. Required.
$applystringMay be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. Default value is None.
$filterstringMay be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). Default value is None.
endDatestringEnd date. Default value is None.
startDatestringStart date. Default value is None.

SELECT examples

Lists the charges based for the defined scope.

SELECT
id,
name,
eTag,
kind,
systemData,
type
FROM azure.consumption.charges
WHERE scope = '{{ scope }}' -- required
AND startDate = '{{ startDate }}'
AND endDate = '{{ endDate }}'
AND $filter = '{{ $filter }}'
AND $apply = '{{ $apply }}'
;