Exports - Create Or Update
用于创建或更新导出的操作。 更新操作要求在请求中设置最新的 eTag。 可以通过执行 get 操作来获取最新的 eTag。 创建操作不需要 eTag。
PUT https://management.azure.com/{scope}/providers/Microsoft.CostManagement/exports/{exportName}?api-version=2025-03-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
export
|
path | True |
string |
导出名称。 |
|
scope
|
path | True |
string |
与导出操作关联的范围。 这包括订阅范围的“/subscriptions/{subscriptionId}/”、resourceGroup 范围的“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}”、 计费帐户范围的“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}”和“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}”,“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{EnrollmentAccount 作用域的 enrollmentAccountId},“/providers/Microsoft.Management/managementGroups/{managementGroupId}”,用于管理组范围, billingProfile 作用域的'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'、'/providers/Microsoft.Billing/billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}',以及'/providers/Microsoft'。Billing/billingAccounts/{billingAccountId}/customers/{customerId}特定于合作伙伴。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| properties.definition | True |
具有导出的定义。 |
|
| properties.deliveryInfo | True |
具有导出的传递信息。 |
|
| eTag |
string |
资源的 eTag。 若要处理并发更新方案,此字段将用于确定用户是否正在更新最新版本。 |
|
| identity |
与导出关联的托管标识 |
||
| location |
string |
导出的托管标识的位置。 仅当使用托管标识时才需要。 |
|
| properties.compressionMode |
允许客户选择压缩数据进行导出。 此设置将在运行时启用目标文件压缩方案。 默认情况下设置为“无”。 Gzip 适用于 csv 和 parquet 的 snappy。 |
||
| properties.dataOverwriteBehavior |
允许客户选择覆盖数据(OverwritePreviousReport)进行导出。 此设置将在客户存储帐户中为同一个月启用覆盖数据。 默认情况下设置为 CreateNewReport。 |
||
| properties.exportDescription |
string |
在创建/更新导出时由客户设置的导出说明。 |
|
| properties.format |
要传递的导出的格式。 |
||
| properties.partitionData |
boolean |
如果设置为 true,则导出的数据将按大小进行分区,并将数据与清单文件一起放置在 Blob 目录中。 |
|
| properties.runHistory |
如果已请求,则具有导出的最新运行历史记录。 |
||
| properties.schedule |
具有导出的计划信息。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
还行。 请求已成功。 |
|
| 201 Created |
创建。 |
|
| Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
ExportCreateOrUpdateByBillingAccount
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByBillingAccountCustom
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Inactive"
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "Custom",
"timePeriod": {
"from": "2025-04-03T00:00:00.000Z",
"to": "2025-04-03T00:00:00.000Z"
},
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Inactive",
"recurrence": "None"
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "Custom",
"timePeriod": {
"from": "2025-04-03T00:00:00Z",
"to": "2025-04-03T00:00:00Z"
},
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Inactive",
"recurrence": "None"
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "Custom",
"timePeriod": {
"from": "2025-04-03T00:00:00Z",
"to": "2025-04-03T00:00:00Z"
},
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByBillingAccountMonthly
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Monthly",
"recurrencePeriod": {
"from": "2020-06-05T00:00:00Z",
"to": "2030-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "TheLastMonth",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Monthly",
"recurrencePeriod": {
"from": "2020-06-05T00:00:00Z",
"to": "2030-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-05T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "TheLastMonth",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Monthly",
"recurrencePeriod": {
"from": "2020-06-05T00:00:00Z",
"to": "2030-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-05T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "TheLastMonth",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByBillingAccountPricesheet
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "PriceSheet",
"timeframe": "TheCurrentMonth",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "PriceSheet",
"timeframe": "TheCurrentMonth",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "PriceSheet",
"timeframe": "TheCurrentMonth",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByBillingAccountReservationDetails
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"dataSet": {
"configuration": {
"dataVersion": "2023-03-01"
},
"granularity": "Daily"
},
"timeframe": "MonthToDate",
"type": "ReservationDetails"
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ReservationDetails",
"timeframe": "MonthToDate",
"dataSet": {
"configuration": {
"columns": [],
"dataVersion": "2023-03-01",
"filters": []
},
"granularity": "Daily"
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ReservationDetails",
"timeframe": "MonthToDate",
"dataSet": {
"configuration": {
"columns": [],
"dataVersion": "2023-03-01",
"filters": []
},
"granularity": "Daily"
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByBillingAccountReservationRecommendation
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"dataSet": {
"configuration": {
"dataVersion": "2023-05-01",
"filters": [
{
"name": "ReservationScope",
"value": "Single"
},
{
"name": "ResourceType",
"value": "VirtualMachines"
},
{
"name": "LookBackPeriod",
"value": "Last7Days"
}
]
}
},
"timeframe": "MonthToDate",
"type": "ReservationRecommendations"
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ReservationRecommendations",
"timeframe": "MonthToDate",
"dataSet": {
"configuration": {
"columns": [],
"dataVersion": "2023-05-01",
"filters": [
{
"name": "ReservationScope",
"value": "Single"
},
{
"name": "ResourceType",
"value": "VirtualMachines"
},
{
"name": "LookBackPeriod",
"value": "Last7Days"
}
]
},
"granularity": null
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ReservationRecommendations",
"timeframe": "MonthToDate",
"dataSet": {
"configuration": {
"columns": [],
"dataVersion": "2023-05-01",
"filters": [
{
"name": "ReservationScope",
"value": "Single"
},
{
"name": "ResourceType",
"value": "VirtualMachines"
},
{
"name": "LookBackPeriod",
"value": "Last7Days"
}
]
},
"granularity": null
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByDepartment
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"format": "Parquet",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "snappy",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Parquet",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "snappy",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Parquet",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "snappy",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByEnrollmentAccount
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByManagementGroup
示例请求
PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateByResourceGroup
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateBySubscription
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2020-06-01T00:00:00Z",
"to": "2020-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2020-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ActualCost",
"timeframe": "MonthToDate",
"dataSet": {
"granularity": "Daily",
"configuration": {
"dataVersion": "2023-05-01"
}
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
ExportCreateOrUpdateExportCreateOrUpdateByBillingAccountReservationTransactionsByBillingAccount
示例请求
PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2025-03-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"format": "Csv",
"deliveryInfo": {
"destination": {
"type": "AzureBlob",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"dataSet": {
"configuration": {
"dataVersion": "2023-05-01"
}
},
"timeframe": "MonthToDate",
"type": "ReservationTransactions"
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
示例响应
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ReservationTransactions",
"timeframe": "MonthToDate",
"dataSet": {
"configuration": {
"columns": [],
"dataVersion": "2023-05-01",
"filters": []
},
"granularity": null
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
{
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
"name": "TestExport",
"type": "Microsoft.CostManagement/exports",
"eTag": "\"00000000-0000-0000-0000-000000000000\"",
"identity": {
"type": "SystemAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
},
"location": "centralus",
"properties": {
"schedule": {
"status": "Active",
"recurrence": "Daily",
"recurrencePeriod": {
"from": "2023-06-01T00:00:00Z",
"to": "2023-06-30T00:00:00Z"
}
},
"nextRunTimeEstimate": "2023-06-01T23:00:00Z",
"format": "Csv",
"deliveryInfo": {
"destination": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
"container": "exports",
"rootFolderPath": "ad-hoc"
}
},
"definition": {
"type": "ReservationTransactions",
"timeframe": "MonthToDate",
"dataSet": {
"configuration": {
"columns": [],
"dataVersion": "2023-05-01",
"filters": []
},
"granularity": null
}
},
"partitionData": true,
"dataOverwriteBehavior": "OverwritePreviousReport",
"compressionMode": "gzip",
"exportDescription": "This is a test export."
}
}
定义
| 名称 | 说明 |
|---|---|
|
Common |
导出的常见属性。 |
|
Compression |
允许客户选择压缩数据进行导出。 此设置将在运行时启用目标文件压缩方案。 默认情况下设置为“无”。 Gzip 适用于 csv 和 parquet 的 snappy。 |
|
Data |
允许客户选择覆盖数据(OverwritePreviousReport)进行导出。 此设置将在客户存储帐户中为同一个月启用覆盖数据。 默认情况下设置为 CreateNewReport。 |
|
Destination |
导出传递目标类型。 目前仅支持“AzureBlob”。 |
|
Error |
错误的详细信息。 |
|
Error |
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。 一些错误响应:
|
|
Execution |
导出运行的最后一个已知状态。 |
|
Execution |
导出运行的类型。 |
| Export |
导出资源。 |
|
Export |
导出中的数据的定义。 |
|
Export |
这是弃用的路径,今后将不受支持。 |
|
Export |
导出的定义。 |
|
Export |
这表示将交付成本的 Blob 存储帐户位置。 有两种方法可以配置目标。 建议大多数客户使用的方法是指定存储帐户的 resourceId。 这需要向 Microsoft.CostManagementExports 资源提供程序注册帐户的订阅,以便向成本管理服务授予对存储的访问权限。 在 Azure 门户中创建导出时,会自动执行此注册,但 API 用户可能需要显式注册订阅(有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services)。 配置目标的另一种方法仅适用于具有Microsoft合作伙伴协议计划的合作伙伴,他们是其计费帐户的全局管理员。 这些合作伙伴可以指定存储帐户名称以及帐户的 SAS 令牌,而不是指定存储帐户的 resourceId。 这允许将成本导出到任何租户中的存储帐户。 应为具有服务/容器/对象资源类型的 Blob 服务创建 SAS 令牌,并使用读/写/删除/列表/添加/创建权限(有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key)。 |
|
Export |
与导出关联的传递信息。 |
|
Export |
列出导出的运行历史记录的结果。 |
|
Export |
定期计划的开始日期和结束日期。 |
|
Export |
导出运行。 |
|
Export |
与导出关联的计划。 |
|
Export |
导出运行的属性。 目前尚未填充。 |
|
Export |
导出中的数据的日期范围。 这只能指定时间帧设置为“Custom”。 最大日期范围为 1 个日历月。 |
|
Export |
导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。 |
|
Filter |
筛选器的名称。 目前仅支持 ReservationRecommendations 的导出定义类型。 支持的名称为 ['ReservationScope', 'LookBackPeriod', 'ResourceType'] |
|
Filter |
将包含要作的筛选器名称和值。 目前仅支持 ReservationRecommendations 的导出定义类型。 |
|
Format |
要传递的导出的格式。 |
|
Granularity |
导出中的行粒度。 目前,大多数情况下支持“每日”。 |
|
Recurrence |
计划重复周期。 |
|
Status |
导出计划的状态。 如果为“非活动”,则导出的计划将暂停。 若要启用导出,请将状态设置为“活动”,然后发出 PUT 请求。 |
|
System |
托管服务标识(系统分配或无) |
|
System |
托管服务标识的类型(系统分配或无)。 |
|
Timeframe |
为导出拉取数据的时间范围。 如果为自定义,则必须提供特定的时间段。 |
CommonExportProperties
导出的常见属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| compressionMode |
允许客户选择压缩数据进行导出。 此设置将在运行时启用目标文件压缩方案。 默认情况下设置为“无”。 Gzip 适用于 csv 和 parquet 的 snappy。 |
|
| dataOverwriteBehavior |
允许客户选择覆盖数据(OverwritePreviousReport)进行导出。 此设置将在客户存储帐户中为同一个月启用覆盖数据。 默认情况下设置为 CreateNewReport。 |
|
| definition |
具有导出的定义。 |
|
| deliveryInfo |
具有导出的传递信息。 |
|
| exportDescription |
string |
在创建/更新导出时由客户设置的导出说明。 |
| format |
要传递的导出的格式。 |
|
| nextRunTimeEstimate |
string (date-time) |
如果导出具有活动计划,则提供下一次运行时的估计值。 |
| partitionData |
boolean |
如果设置为 true,则导出的数据将按大小进行分区,并将数据与清单文件一起放置在 Blob 目录中。 |
| runHistory |
如果已请求,则具有导出的最新运行历史记录。 |
|
| systemSuspensionContext |
如果导出处于 SystemSuspended 状态,则导出挂起原因。 目前尚未填充。 |
CompressionModeType
允许客户选择压缩数据进行导出。 此设置将在运行时启用目标文件压缩方案。 默认情况下设置为“无”。 Gzip 适用于 csv 和 parquet 的 snappy。
| 值 | 说明 |
|---|---|
| gzip | |
| snappy | |
| none |
DataOverwriteBehaviorType
允许客户选择覆盖数据(OverwritePreviousReport)进行导出。 此设置将在客户存储帐户中为同一个月启用覆盖数据。 默认情况下设置为 CreateNewReport。
| 值 | 说明 |
|---|---|
| OverwritePreviousReport | |
| CreateNewReport |
DestinationType
导出传递目标类型。 目前仅支持“AzureBlob”。
| 值 | 说明 |
|---|---|
| AzureBlob |
ErrorDetails
错误的详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
指示操作失败的原因的错误消息。 |
ErrorResponse
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。
一些错误响应:
429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。
503 ServiceUnavailable - 服务暂时不可用。 在等待“Retry-After”标头中指定的时间后重试。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误的详细信息。 |
ExecutionStatus
导出运行的最后一个已知状态。
| 值 | 说明 |
|---|---|
| Queued | |
| InProgress | |
| Completed | |
| Failed | |
| Timeout | |
| NewDataNotAvailable | |
| DataNotAvailable |
ExecutionType
导出运行的类型。
| 值 | 说明 |
|---|---|
| OnDemand | |
| Scheduled |
Export
导出资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| eTag |
string |
资源的 eTag。 若要处理并发更新方案,此字段将用于确定用户是否正在更新最新版本。 |
| id |
string |
资源 ID。 |
| identity |
与导出关联的托管标识 |
|
| location |
string |
导出的托管标识的位置。 仅当使用托管标识时才需要。 |
| name |
string |
资源名称。 |
| properties.compressionMode |
允许客户选择压缩数据进行导出。 此设置将在运行时启用目标文件压缩方案。 默认情况下设置为“无”。 Gzip 适用于 csv 和 parquet 的 snappy。 |
|
| properties.dataOverwriteBehavior |
允许客户选择覆盖数据(OverwritePreviousReport)进行导出。 此设置将在客户存储帐户中为同一个月启用覆盖数据。 默认情况下设置为 CreateNewReport。 |
|
| properties.definition |
具有导出的定义。 |
|
| properties.deliveryInfo |
具有导出的传递信息。 |
|
| properties.exportDescription |
string |
在创建/更新导出时由客户设置的导出说明。 |
| properties.format |
要传递的导出的格式。 |
|
| properties.nextRunTimeEstimate |
string (date-time) |
如果导出具有活动计划,则提供下一次运行时的估计值。 |
| properties.partitionData |
boolean |
如果设置为 true,则导出的数据将按大小进行分区,并将数据与清单文件一起放置在 Blob 目录中。 |
| properties.runHistory |
如果已请求,则具有导出的最新运行历史记录。 |
|
| properties.schedule |
具有导出的计划信息。 |
|
| properties.systemSuspensionContext |
如果导出处于 SystemSuspended 状态,则导出挂起原因。 目前尚未填充。 |
|
| type |
string |
资源类型。 |
ExportDataset
导出中的数据的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| configuration |
导出数据集配置。 |
|
| granularity |
导出中的行粒度。 目前,大多数情况下支持“每日”。 |
ExportDatasetConfiguration
这是弃用的路径,今后将不受支持。
| 名称 | 类型 | 说明 |
|---|---|---|
| columns |
string[] |
要包含在导出中的列名数组。 如果未提供,导出将包含所有可用列。 可用列可能因客户渠道而异(请参阅示例)。 |
| dataVersion |
string |
为导出选择的数据版本。 如果未提供,导出将默认为最新数据版本。 |
| filters |
与数据集关联的筛选器。 |
ExportDefinition
导出的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| dataSet |
导出中的数据的定义。 |
|
| timePeriod |
具有为导出拉取数据的时间段。 |
|
| timeframe |
为导出拉取数据的时间范围。 如果为自定义,则必须提供特定的时间段。 |
|
| type |
导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。 |
ExportDeliveryDestination
这表示将交付成本的 Blob 存储帐户位置。 有两种方法可以配置目标。 建议大多数客户使用的方法是指定存储帐户的 resourceId。 这需要向 Microsoft.CostManagementExports 资源提供程序注册帐户的订阅,以便向成本管理服务授予对存储的访问权限。 在 Azure 门户中创建导出时,会自动执行此注册,但 API 用户可能需要显式注册订阅(有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services)。 配置目标的另一种方法仅适用于具有Microsoft合作伙伴协议计划的合作伙伴,他们是其计费帐户的全局管理员。 这些合作伙伴可以指定存储帐户名称以及帐户的 SAS 令牌,而不是指定存储帐户的 resourceId。 这允许将成本导出到任何租户中的存储帐户。 应为具有服务/容器/对象资源类型的 Blob 服务创建 SAS 令牌,并使用读/写/删除/列表/添加/创建权限(有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key)。
| 名称 | 类型 | 说明 |
|---|---|---|
| container |
string |
将上传导出的容器的名称。 如果容器不存在,则会创建该容器。 |
| resourceId |
string |
将交付导出的存储帐户的资源 ID。 如果指定了 sasToken 和 storageAccount,则不需要这样做。 |
| rootFolderPath |
string |
将上传导出的目录的名称。 |
| sasToken |
string |
存储帐户的 SAS 令牌。 对于受限的一组 Azure 客户,可以指定它和 storageAccount,而不是 resourceId。 注意:API 为此属性返回的值将始终被模糊处理。 返回相同的模糊值不会更新 SAS 令牌。 若要更新此值,必须指定新的 SAS 令牌。 |
| storageAccount |
string |
将上传导出的存储帐户。 对于受限的一组 Azure 客户,可以指定 sasToken 而不是 resourceId。 |
| type |
导出传递目标类型。 目前仅支持“AzureBlob”。 |
ExportDeliveryInfo
与导出关联的传递信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| destination |
具有要传递的导出的目标。 |
ExportExecutionListResult
列出导出的运行历史记录的结果。
| 名称 | 类型 | 说明 |
|---|---|---|
| value |
导出运行的列表。 |
ExportRecurrencePeriod
定期计划的开始日期和结束日期。
| 名称 | 类型 | 说明 |
|---|---|---|
| from |
string (date-time) |
定期的开始日期。 |
| to |
string (date-time) |
重复周期的结束日期。 |
ExportRun
导出运行。
| 名称 | 类型 | 说明 |
|---|---|---|
| eTag |
string |
资源的 eTag。 若要处理并发更新方案,此字段将用于确定用户是否正在更新最新版本。 |
| id |
string |
资源 ID。 |
| name |
string |
资源名称。 |
| properties.endDate |
string (date-time) |
导出的结束日期/时间。 |
| properties.error |
任何错误的详细信息。 |
|
| properties.executionType |
导出运行的类型。 |
|
| properties.fileName |
string |
导出的文件的名称。 |
| properties.manifestFile |
string |
导出文件的清单文件位置(URI 位置)。 |
| properties.processingEndTime |
string (date-time) |
导出运行完成的时间。 |
| properties.processingStartTime |
string (date-time) |
导出开始运行的时间。 |
| properties.runSettings |
此运行生效的导出设置。 |
|
| properties.startDate |
string (date-time) |
导出的开始日期时间。 |
| properties.status |
导出运行的最后一个已知状态。 |
|
| properties.submittedBy |
string |
触发导出的实体的标识符。 对于按需运行,它是用户电子邮件。 对于计划运行,它是“系统”。 |
| properties.submittedTime |
string (date-time) |
导出排队运行的时间。 |
| type |
string |
资源类型。 |
ExportSchedule
与导出关联的计划。
| 名称 | 类型 | 说明 |
|---|---|---|
| recurrence |
计划重复周期。 |
|
| recurrencePeriod |
具有重复周期的开始和结束日期。 开始日期必须在将来。 如果存在,则结束日期必须大于开始日期。 |
|
| status |
导出计划的状态。 如果为“非活动”,则导出的计划将暂停。 若要启用导出,请将状态设置为“活动”,然后发出 PUT 请求。 |
ExportSuspensionContext
导出运行的属性。 目前尚未填充。
| 名称 | 类型 | 说明 |
|---|---|---|
| suspensionCode |
string |
导出挂起的代码。 |
| suspensionReason |
string |
导出挂起的详细原因。 |
| suspensionTime |
string (date-time) |
导出暂停的时间。 |
ExportTimePeriod
导出中的数据的日期范围。 这只能指定时间帧设置为“Custom”。 最大日期范围为 1 个日历月。
| 名称 | 类型 | 说明 |
|---|---|---|
| from |
string (date-time) |
导出数据的开始日期。 |
| to |
string (date-time) |
导出数据的结束日期。 |
ExportType
导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。
| 值 | 说明 |
|---|---|
| Usage | |
| ActualCost | |
| AmortizedCost | |
| FocusCost | |
| PriceSheet | |
| ReservationTransactions | |
| ReservationRecommendations | |
| ReservationDetails |
FilterItemNames
筛选器的名称。 目前仅支持 ReservationRecommendations 的导出定义类型。 支持的名称为 ['ReservationScope', 'LookBackPeriod', 'ResourceType']
| 值 | 说明 |
|---|---|
| ReservationScope | |
| ResourceType | |
| LookBackPeriod |
FilterItems
将包含要作的筛选器名称和值。 目前仅支持 ReservationRecommendations 的导出定义类型。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
筛选器的名称。 目前仅支持 ReservationRecommendations 的导出定义类型。 支持的名称为 ['ReservationScope', 'LookBackPeriod', 'ResourceType'] |
|
| value |
string |
要筛选依据的值。 目前每个名称支持的值是,对于“ReservationScope”支持的值是 ['Single', 'Shared'], 对于 'LookBackPeriod' 支持的值是 ['Last7Days', 'Last30Days', 'Last60Days'] 和 'ResourceType' 支持的值是 ['VirtualMachines', “SQLDatabases”、“PostgreSQL”、“ManagedDisk”、“MySQL”、“RedHat”、“MariaDB”、“RedisCache”、“CosmosDB”、“SqlDataWarehouse”、“SUSELinux”、“AppService”、“BlockBlob”、“AzureDataExplorer”、“VMwareCloudSimple”。 |
FormatType
要传递的导出的格式。
| 值 | 说明 |
|---|---|
| Csv | |
| Parquet |
GranularityType
导出中的行粒度。 目前,大多数情况下支持“每日”。
| 值 | 说明 |
|---|---|
| Daily | |
| Monthly |
RecurrenceType
计划重复周期。
| 值 | 说明 |
|---|---|
| Daily | |
| Weekly | |
| Monthly | |
| Annually |
StatusType
导出计划的状态。 如果为“非活动”,则导出的计划将暂停。 若要启用导出,请将状态设置为“活动”,然后发出 PUT 请求。
| 值 | 说明 |
|---|---|
| Active | |
| Inactive |
SystemAssignedServiceIdentity
托管服务标识(系统分配或无)
| 名称 | 类型 | 说明 |
|---|---|---|
| principalId |
string (uuid) |
系统分配标识的服务主体 ID。 此属性仅针对系统分配的标识提供。 |
| tenantId |
string (uuid) |
系统分配标识的租户 ID。 此属性仅针对系统分配的标识提供。 |
| type |
托管服务标识的类型(系统分配或无)。 |
SystemAssignedServiceIdentityType
托管服务标识的类型(系统分配或无)。
| 值 | 说明 |
|---|---|
| None | |
| SystemAssigned |
TimeframeType
为导出拉取数据的时间范围。 如果为自定义,则必须提供特定的时间段。
| 值 | 说明 |
|---|---|
| MonthToDate | |
| BillingMonthToDate | |
| TheLastMonth | |
| TheLastBillingMonth | |
| WeekToDate | |
| Custom | |
| TheCurrentMonth |