Skip to main content

usage_details

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

Overview​

Nameusage_details
TypeResource
Idazure.consumption.usage_details

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.
etagstringThe etag for the resource.
kindstringSpecifies the kind of usage details. Required. Known values are: "legacy" and "modern".
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
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
listselectscope$expand, $filter, $skiptoken, $top, metricLists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify customers once a date for retirement has been determined.For Learn more,see Generate Cost Details Report - Create Operation.

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.
$expandstringMay be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. Default value is None.
$filterstringMay be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. Default value is None.
$skiptokenstringSkiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Default value is None.
$topintegerMay be used to limit the number of results to the most recent N usageDetails. Default value is None.
metricstringAllows to select different type of cost/usage records. Known values are: "actualcost", "amortizedcost", and "usage". Default value is None.

SELECT examples​

Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify customers once a date for retirement has been determined.For Learn more,see Generate Cost Details Report - Create Operation.

SELECT
id,
name,
etag,
kind,
systemData,
tags,
type
FROM azure.consumption.usage_details
WHERE scope = '{{ scope }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $skiptoken = '{{ $skiptoken }}'
AND $top = '{{ $top }}'
AND metric = '{{ metric }}'
;