Generate Cost Details Report - Get Operation Results

Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header.

GET https://management.azure.com/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}?api-version=2023-11-01

URI Parameters

Name In Required Type Description
operationId
path True

string

The target operation Id.

scope
path True

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.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

CostDetailsOperationResults

OK. The request has succeeded.

202 Accepted

Accepted. The operation is ongoing.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Get details of the operation result

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000?api-version=2023-11-01

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000",
  "name": "00000000-0000-0000-0000-000000000000",
  "status": "Completed",
  "manifest": {
    "manifestVersion": "2023-11-01",
    "dataFormat": "Csv",
    "blobCount": 1,
    "byteCount": 32741,
    "compressData": false,
    "requestContext": {
      "requestScope": "subscriptions/00000000-0000-0000-0000-000000000000",
      "requestBody": {
        "metric": "ActualCost",
        "timePeriod": {
          "start": "2020-03-01",
          "end": "2020-03-15"
        }
      }
    },
    "blobs": [
      {
        "blobLink": "https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd",
        "byteCount": 32741
      }
    ]
  },
  "validTill": "2022-05-10T08:08:46.1973252Z"
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000?api-version=2023-11-01
Retry-After: 60

Definitions

Name Description
BlobInfo

The blob information generated by this operation.

CostDetailsDataFormat

The data format of the report

CostDetailsMetricType

The type of the detailed report. By default ActualCost is provided

CostDetailsOperationResults

The result of the long running operation for cost details Api.

CostDetailsStatusType

The status of the cost details operation

CostDetailsTimePeriod

The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months.

ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

GenerateCostDetailsReportRequestDefinition

The definition of a cost detailed report.

BlobInfo

The blob information generated by this operation.

Name Type Description
blobLink

string

Link to the blob to download file.

byteCount

integer

Bytes in the blob.

CostDetailsDataFormat

The data format of the report

Name Type Description
Csv

string

Csv data format.

CostDetailsMetricType

The type of the detailed report. By default ActualCost is provided

Name Type Description
ActualCost

string

Actual cost data.

AmortizedCost

string

Amortized cost data.

CostDetailsOperationResults

The result of the long running operation for cost details Api.

Name Type Description
error

ErrorDetails

The details of the error.

id

string

The id of the long running operation.

manifest.blobCount

integer

The total number of blobs.

manifest.blobs

BlobInfo[]

List of blob information generated by this operation.

manifest.byteCount

integer

The total number of bytes in all blobs.

manifest.compressData

boolean

Is the data in compressed format.

manifest.dataFormat

CostDetailsDataFormat

The data format of the report

manifest.manifestVersion

string

The Manifest version.

manifest.requestContext.requestBody

GenerateCostDetailsReportRequestDefinition

The request payload body provided in Cost Details call

manifest.requestContext.requestScope

string

The request scope of the request.

name

string

The name of the long running operation.

status

CostDetailsStatusType

The status of the cost details operation

type

string

The type of the long running operation.

validTill

string

The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.

CostDetailsStatusType

The status of the cost details operation

Name Type Description
Completed

string

Operation is Completed.

Failed

string

Operation Failed.

NoDataFound

string

Operation is Completed and no cost data found.

CostDetailsTimePeriod

The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months.

Name Type Description
end

string

The end date to pull data to. example format 2020-03-15

start

string

The start date to pull data from. example format 2020-03-15

ErrorDetails

The details of the error.

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

Name Type Description
error

ErrorDetails

The details of the error.

GenerateCostDetailsReportRequestDefinition

The definition of a cost detailed report.

Name Type Description
billingPeriod

string

This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.

invoiceId

string

This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.

metric

CostDetailsMetricType

The type of the detailed report. By default ActualCost is provided

timePeriod

CostDetailsTimePeriod

The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period