Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for Enterprise Agreement customers.
Migrate to version 2025-03-01
You can use the 2025-03-01 API version with the new URI:
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download'
With a new schema detailed below, the new version of the price sheet provides additional information and includes prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved Instance (RI) pricing.
The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a billing period older than 13 months, please contact support.
The Azure price sheet download experience has been updated from a single .csv file to a zip file containing multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST method; details can be found below.
All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no longer be supported after this date.
POST https://management.azure.com/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download?api-version=2025-03-01
URI Parameters
| Name |
In |
Required |
Type |
Description |
|
billingAccountId
|
path |
True
|
string
|
BillingAccount ID
|
|
billingPeriodName
|
path |
True
|
string
pattern: ^[0-9]*$
|
Billing Period Name.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
Responses
| Name |
Type |
Description |
|
200 OK
|
OperationStatus
|
The request has succeeded.
|
|
202 Accepted
|
|
Resource operation accepted.
Headers
Location: string
|
|
Other Status Codes
|
ErrorResponse
|
An unexpected error response.
|
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
EAPriceSheetForBillingPeriod
Sample request
POST https://management.azure.com/providers/microsoft.Billing/billingAccounts/0000000/billingPeriods/202311/providers/Microsoft.CostManagement/pricesheets/default/download?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python ea_price_sheet_for_billing_period.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.price_sheet.begin_download_by_billing_account(
billing_account_id="0000000",
billing_period_name="202311",
).result()
print(response)
# x-ms-original-file: 2025-03-01/EAPriceSheetForBillingPeriod.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/EAPriceSheetForBillingPeriod.json
func ExamplePriceSheetClient_BeginDownloadByBillingAccount() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPriceSheetClient().BeginDownloadByBillingAccount(ctx, "0000000", "202311", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.PriceSheetClientDownloadByBillingAccountResponse{
// OperationStatus: armcostmanagement.OperationStatus{
// Properties: &armcostmanagement.ReportURL{
// ReportURL: to.Ptr(armcostmanagement.ReservationReportSchema("https://myaccount.blob.core.windows.net/reportfile.csv?sv=2015-04-05&ss=bf&srt=s&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&spr=https&sig=G%2TEST%4B")),
// ValidUntil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T17:32:28Z"); return t}()),
// },
// Status: to.Ptr(armcostmanagement.OperationStatusTypeCompleted),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CostManagementClient } = require("@azure/arm-costmanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for Enterprise Agreement customers.
*
* **Migrate to version 2025-03-01**
*
* You can use the 2025-03-01 API version with the new URI:
*
* '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download'
*
* With a new schema detailed below, the new version of the price sheet provides additional information and includes prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved Instance (RI) pricing.
*
* The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a billing period older than 13 months, please contact support.
*
* The Azure price sheet download experience has been updated from a single .csv file to a zip file containing multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST method; details can be found below.
*
* All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no longer be supported after this date.
*
* @summary generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for Enterprise Agreement customers.
*
* **Migrate to version 2025-03-01**
*
* You can use the 2025-03-01 API version with the new URI:
*
* '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download'
*
* With a new schema detailed below, the new version of the price sheet provides additional information and includes prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved Instance (RI) pricing.
*
* The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a billing period older than 13 months, please contact support.
*
* The Azure price sheet download experience has been updated from a single .csv file to a zip file containing multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST method; details can be found below.
*
* All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no longer be supported after this date.
* x-ms-original-file: 2025-03-01/EAPriceSheetForBillingPeriod.json
*/
async function eaPriceSheetForBillingPeriod() {
const credential = new DefaultAzureCredential();
const client = new CostManagementClient(credential);
const result = await client.priceSheet.downloadByBillingAccount("0000000", "202311");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"reportUrl": "https://myaccount.blob.core.windows.net/reportfile.csv?sv=2015-04-05&ss=bf&srt=s&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&spr=https&sig=G%2TEST%4B",
"validUntil": "2023-09-30T17:32:28Z"
},
"status": "Completed"
}
Location: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/0000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-09-01
Retry-After: 60
Definitions
| Name |
Description |
|
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. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
|
|
OperationStatus
|
The status of the long running operation.
|
|
OperationStatusType
|
Enum representing the status of an async operation.
|
|
ReservationReportSchema
|
The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity
|
ErrorDetails
Object
The details of the error.
| Name |
Type |
Description |
|
code
|
string
|
Error code.
|
|
message
|
string
|
Error message indicating why the operation failed.
|
ErrorResponse
Object
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. \n\n * 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.
|
OperationStatus
Object
The status of the long running operation.
| Name |
Type |
Description |
|
properties.reportUrl
|
ReservationReportSchema
|
The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity
|
|
properties.validUntil
|
string
(date-time)
|
The time at which report URL becomes invalid.
|
|
status
|
OperationStatusType
|
The status of the long running operation.
|
OperationStatusType
Enumeration
Enum representing the status of an async operation.
| Value |
Description |
|
Running
|
|
|
Completed
|
|
|
Failed
|
|
ReservationReportSchema
Enumeration
The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity
| Value |
Description |
|
InstanceFlexibilityGroup
|
|
|
InstanceFlexibilityRatio
|
|
|
InstanceId
|
|
|
Kind
|
|
|
ReservationId
|
|
|
ReservationOrderId
|
|
|
ReservedHours
|
|
|
SkuName
|
|
|
TotalReservedQuantity
|
|
|
UsageDate
|
|
|
UsedHours
|
|