generate_cost_details_report
Creates, updates, deletes, gets or lists a generate_cost_details_report resource.
Overview
| Name | generate_cost_details_report |
| Type | Resource |
| Id | azure.cost_management.generate_cost_details_report |
Fields
The following fields are returned by SELECT queries:
- get_operation_results
| Name | Datatype | Description |
|---|---|---|
id | string | The id of the long running operation. |
name | string | The name of the long running operation. |
error | object | The details of the error. |
manifest | object | The manifest of the report generated by the operation. |
status | string | The status of the cost details operation. Known values are: "Completed", "NoDataFound", and "Failed". (Completed, NoDataFound, Failed) |
type | string | The type of the long running operation. |
validTill | string (date-time) | The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_operation_results | select | scope, operation_id | Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header. | |
create_operation | exec | scope | This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202 with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll to get the result of the report generation. The 'Retry-After' provides the duration to wait before polling for the generated report. A call to poll the report operation will provide a 202 response with a 'Location' header if the operation is still in progress. Once the report generation operation completes, the polling endpoint will provide a 200 response along with details on the report blob(s) that are available for download. The details on the file(s) available for download will be available in the polling response body. To Understand cost details (formerly known as usage details) fields found in files ,see https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields _. |
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 |
|---|---|---|
operation_id | string | The target operation Id. Required. |
scope | string | The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes _. Required. |
SELECT examples
- get_operation_results
Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header.
SELECT
id,
name,
error,
manifest,
status,
type,
validTill
FROM azure.cost_management.generate_cost_details_report
WHERE scope = '{{ scope }}' -- required
AND operation_id = '{{ operation_id }}' -- required
;
Lifecycle Methods
- create_operation
This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202 with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll to get the result of the report generation. The 'Retry-After' provides the duration to wait before polling for the generated report. A call to poll the report operation will provide a 202 response with a 'Location' header if the operation is still in progress. Once the report generation operation completes, the polling endpoint will provide a 200 response along with details on the report blob(s) that are available for download. The details on the file(s) available for download will be available in the polling response body. To Understand cost details (formerly known as usage details) fields found in files ,see https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields _.
EXEC azure.cost_management.generate_cost_details_report.create_operation
@scope='{{ scope }}' --required
@@json=
'{
"metric": "{{ metric }}",
"timePeriod": "{{ timePeriod }}",
"billingPeriod": "{{ billingPeriod }}",
"invoiceId": "{{ invoiceId }}"
}'
;