你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Exports - Create Or Update

用于创建或更新导出的操作。 更新操作需要在请求中设置最新的 eTag。 可以通过执行 get 操作来获取最新的 eTag。 创建操作不需要 eTag。

PUT https://management.azure.com/{scope}/providers/Microsoft.CostManagement/exports/{exportName}?api-version=2023-11-01

URI 参数

名称 必需 类型 说明
exportName
path True

string

导出名称。

scope
path True

string

与导出操作关联的范围。 这包括订阅范围的“/subscriptions/{subscriptionId}/” resourceGroup 范围的“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}”,计费帐户范围的“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}”和“/providers/Microsoft.Billing/billingAccounts/{billingAccounts/{departmentId}”,“/providers/Microsoft.Billing/billingAccounts/{billingAccounts}/enrollmentAccounts/{enrollmentAccountId},对于 EnrollmentAccount 范围,“/providers/Microsoft.Management/managementGroups/{managementGroupId}”,用于管理组范围, billingProfile 范围的'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}“、'/providers/Microsoft.Billing/billingAccounts}/billingProfiles/{billingProfileId}/{billingProfileId}/invoiceSections/{invoiceSectionId}'”以及“/providers/Microsoft”。特定于合作伙伴的 Billing/billingAccounts/{billingAccountId}/customers/{customerId}。

api-version
query True

string

要用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
properties.definition True

ExportDefinition

具有导出的定义。

properties.deliveryInfo True

ExportDeliveryInfo

具有导出的传递信息。

eTag

string

资源的 eTag。 为了处理并发更新方案,此字段将用于确定用户是否要更新最新版本。

identity

SystemAssignedServiceIdentity

与导出关联的托管标识

location

string

导出的托管标识的位置。 仅在使用托管标识时才需要。

properties.format

FormatType

要传递的导出的格式。 目前仅支持“Csv”。

properties.partitionData

boolean

如果设置为 true,则导出的数据将按大小进行分区,并连同清单文件一起放置在 Blob 目录中。 注意:此选项目前仅适用于Microsoft 客户协议商业范围。

properties.runHistory

ExportExecutionListResult

如果请求,则具有导出的最新运行历史记录。

properties.schedule

ExportSchedule

具有导出的计划信息。

响应

名称 类型 说明
200 OK

Export

没问题。 请求已成功。

201 Created

Export

Created.

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

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

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ExportCreateOrUpdateByBillingAccount
ExportCreateOrUpdateByDepartment
ExportCreateOrUpdateByEnrollmentAccount
ExportCreateOrUpdateByManagementGroup
ExportCreateOrUpdateByResourceGroup
ExportCreateOrUpdateBySubscription

ExportCreateOrUpdateByBillingAccount

Sample Request

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2023-11-01

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

Sample Response

{
  "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}
{
  "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

ExportCreateOrUpdateByDepartment

Sample Request

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport?api-version=2023-11-01

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

Sample Response

{
  "id": "providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}
{
  "id": "providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

ExportCreateOrUpdateByEnrollmentAccount

Sample Request

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport?api-version=2023-11-01

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

Sample Response

{
  "id": "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}
{
  "id": "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

ExportCreateOrUpdateByManagementGroup

Sample Request

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport?api-version=2023-11-01

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

Sample Response

{
  "id": "providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}
{
  "id": "providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

ExportCreateOrUpdateByResourceGroup

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport?api-version=2023-11-01

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}
{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

ExportCreateOrUpdateBySubscription

Sample Request

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

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}
{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport",
  "name": "TestExport",
  "type": "Microsoft.CostManagement/exports",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "00000000-0000-0000-0000-000000000000",
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "centralus",
  "properties": {
    "schedule": {
      "status": "Active",
      "recurrence": "Weekly",
      "recurrencePeriod": {
        "from": "2020-06-01T00:00:00Z",
        "to": "2020-10-31T00: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": {
          "columns": [
            "Date",
            "MeterId",
            "ResourceId",
            "ResourceLocation",
            "Quantity"
          ]
        }
      }
    }
  }
}

定义

名称 说明
CommonExportProperties

导出的常用属性。

ErrorDetails

错误的详细信息。

ErrorResponse

错误响应指示服务无法处理传入请求。 错误消息中提供了原因。

某些错误响应:

  • 429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。

  • 503 ServiceUnavailable - 服务暂时不可用。 等待“Retry-After”标头中指定的时间后重试。

ExecutionStatus

导出运行的最后一个已知状态。

ExecutionType

导出运行的类型。

Export

导出资源。

ExportDataset

导出中数据的定义。

ExportDatasetConfiguration

导出数据集配置。 允许为导出选择列。 如果未提供,则导出将包括所有可用列。

ExportDefinition

导出的定义。

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 ) 。

ExportDeliveryInfo

与导出关联的传递信息。

ExportExecutionListResult

列出导出的运行历史记录的结果。

ExportRecurrencePeriod

定期计划的开始和结束日期。

ExportRun

导出运行。

ExportSchedule

与导出关联的计划。

ExportTimePeriod

导出中数据的日期范围。 仅应在 timeFrame 设置为“Custom”的情况下指定此值。 最大日期范围为 3 个月。

ExportType

导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。

FormatType

要传递的导出的格式。 目前仅支持“Csv”。

GranularityType

导出中行的粒度。 目前仅支持“每日”。

RecurrenceType

计划重复周期。

StatusType

导出计划的状态。 如果“非活动”,则暂停导出的计划。

SystemAssignedServiceIdentity

托管服务标识 (系统分配或无)

SystemAssignedServiceIdentityType

托管服务标识的类型 (系统分配或无) 。

TimeframeType

为导出拉取数据的时间范围。 如果自定义,则必须提供特定的时间段。

CommonExportProperties

导出的常用属性。

名称 类型 说明
definition

ExportDefinition

具有导出的定义。

deliveryInfo

ExportDeliveryInfo

具有导出的传递信息。

format

FormatType

要传递的导出的格式。 目前仅支持“Csv”。

nextRunTimeEstimate

string

如果导出具有活动计划,则提供下一次运行时的估计值。

partitionData

boolean

如果设置为 true,则导出的数据将按大小进行分区,并连同清单文件一起放置在 Blob 目录中。 注意:此选项目前仅适用于Microsoft 客户协议商业范围。

runHistory

ExportExecutionListResult

如果请求,则具有导出的最新运行历史记录。

ErrorDetails

错误的详细信息。

名称 类型 说明
code

string

错误代码。

message

string

指示操作失败原因的错误消息。

ErrorResponse

错误响应指示服务无法处理传入请求。 错误消息中提供了原因。

某些错误响应:

  • 429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。

  • 503 ServiceUnavailable - 服务暂时不可用。 等待“Retry-After”标头中指定的时间后重试。

名称 类型 说明
error

ErrorDetails

错误的详细信息。

ExecutionStatus

导出运行的最后一个已知状态。

名称 类型 说明
Completed

string

DataNotAvailable

string

Failed

string

InProgress

string

NewDataNotAvailable

string

Queued

string

Timeout

string

ExecutionType

导出运行的类型。

名称 类型 说明
OnDemand

string

Scheduled

string

Export

导出资源。

名称 类型 说明
eTag

string

资源的 eTag。 为了处理并发更新方案,此字段将用于确定用户是否要更新最新版本。

id

string

资源 ID。

identity

SystemAssignedServiceIdentity

与导出关联的托管标识

location

string

导出的托管标识的位置。 仅在使用托管标识时才需要。

name

string

资源名称。

properties.definition

ExportDefinition

具有导出的定义。

properties.deliveryInfo

ExportDeliveryInfo

具有导出的传递信息。

properties.format

FormatType

要传递的导出的格式。 目前仅支持“Csv”。

properties.nextRunTimeEstimate

string

如果导出具有活动计划,则提供下一次运行时的估计值。

properties.partitionData

boolean

如果设置为 true,则导出的数据将按大小进行分区,并连同清单文件一起放置在 Blob 目录中。 注意:此选项目前仅适用于Microsoft 客户协议商业范围。

properties.runHistory

ExportExecutionListResult

如果请求,则具有导出的最新运行历史记录。

properties.schedule

ExportSchedule

具有导出的计划信息。

type

string

资源类型。

ExportDataset

导出中数据的定义。

名称 类型 说明
configuration

ExportDatasetConfiguration

导出数据集配置。

granularity

GranularityType

导出中行的粒度。 目前仅支持“每日”。

ExportDatasetConfiguration

导出数据集配置。 允许为导出选择列。 如果未提供,则导出将包括所有可用列。

名称 类型 说明
columns

string[]

要包含在导出中的列名数组。 如果未提供,则导出将包括所有可用列。 可用列可能因客户渠道而异, (查看示例) 。

ExportDefinition

导出的定义。

名称 类型 说明
dataSet

ExportDataset

导出中数据的定义。

timePeriod

ExportTimePeriod

具有为导出拉取数据的时间段。

timeframe

TimeframeType

为导出拉取数据的时间范围。 如果自定义,则必须提供特定的时间段。

type

ExportType

导出的类型。 请注意,“使用情况”等效于“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。

ExportDeliveryInfo

与导出关联的传递信息。

名称 类型 说明
destination

ExportDeliveryDestination

具有要传递的导出的目标。

ExportExecutionListResult

列出导出的运行历史记录的结果。

名称 类型 说明
value

ExportRun[]

导出运行的列表。

ExportRecurrencePeriod

定期计划的开始和结束日期。

名称 类型 说明
from

string

定期的开始日期。

to

string

定期的结束日期。

ExportRun

导出运行。

名称 类型 说明
eTag

string

资源的 eTag。 为了处理并发更新方案,此字段将用于确定用户是否要更新最新版本。

id

string

资源 ID。

name

string

资源名称。

properties.error

ErrorDetails

任何错误的详细信息。

properties.executionType

ExecutionType

导出运行的类型。

properties.fileName

string

导出文件的文件名。

properties.processingEndTime

string

导出运行完成的时间。

properties.processingStartTime

string

提取导出以运行的时间。

properties.runSettings

CommonExportProperties

此运行有效的导出设置。

properties.status

ExecutionStatus

导出运行的最后一个已知状态。

properties.submittedBy

string

触发导出的实体的标识符。 对于按需运行,它是用户电子邮件。 对于计划运行,它是“系统”。

properties.submittedTime

string

导出排队运行的时间。

type

string

资源类型。

ExportSchedule

与导出关联的计划。

名称 类型 说明
recurrence

RecurrenceType

计划重复周期。

recurrencePeriod

ExportRecurrencePeriod

具有定期的开始和结束日期。 开始日期必须为将来。 如果存在,则结束日期必须大于开始日期。

status

StatusType

导出计划的状态。 如果“非活动”,则暂停导出的计划。

ExportTimePeriod

导出中数据的日期范围。 仅应在 timeFrame 设置为“Custom”的情况下指定此值。 最大日期范围为 3 个月。

名称 类型 说明
from

string

导出数据的开始日期。

to

string

导出数据的结束日期。

ExportType

导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。

名称 类型 说明
ActualCost

string

AmortizedCost

string

Usage

string

FormatType

要传递的导出的格式。 目前仅支持“Csv”。

名称 类型 说明
Csv

string

GranularityType

导出中行的粒度。 目前仅支持“每日”。

名称 类型 说明
Daily

string

RecurrenceType

计划重复周期。

名称 类型 说明
Annually

string

Daily

string

Monthly

string

Weekly

string

StatusType

导出计划的状态。 如果“非活动”,则暂停导出的计划。

名称 类型 说明
Active

string

Inactive

string

SystemAssignedServiceIdentity

托管服务标识 (系统分配或无)

名称 类型 说明
principalId

string

系统分配的标识的服务主体 ID。 仅为系统分配的标识提供此属性。

tenantId

string

系统分配的标识的租户 ID。 仅为系统分配的标识提供此属性。

type

SystemAssignedServiceIdentityType

托管服务标识的类型 (系统分配或无) 。

SystemAssignedServiceIdentityType

托管服务标识的类型 (系统分配或无) 。

名称 类型 说明
None

string

SystemAssigned

string

TimeframeType

为导出拉取数据的时间范围。 如果自定义,则必须提供特定的时间段。

名称 类型 说明
BillingMonthToDate

string

Custom

string

MonthToDate

string

TheLastBillingMonth

string

TheLastMonth

string

WeekToDate

string