Exports - Create Or Update

要建立或更新導出的作業。 更新作業需要在要求中設定最新的 eTag。 您可以藉由執行取得作業來取得最新的 eTag。 建立作業不需要 eTag。

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

URI 參數

名稱 位於 必要 類型 Description
exportName
path True

string

匯出名稱。

scope
path True

string

與導出作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' 、計費帳戶範圍的 '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' 和 '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' 適用於部門範圍、'/providers/Microsoft.Billing/billingAccountId}/{billingAccountId}/enrollmentAccounts/{EnrollmentAccount 範圍、'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope 的 enrollmentAccountId}' billingProfile 範圍的 '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/{billingProfiles/{billingProfileId}'、'/providers/Microsoft.Billing/billingAccountId}/{billingProfileId}/{billingProfileId}/invoiceSections/{invoiceSectionId}' 和 '/providers/Microsoft' 。Billing/billingAccounts/{billingAccountId}/customers/{customerId}' 專屬合作夥伴。

api-version
query True

string

用於此作業的 API 版本。

要求本文

名稱 必要 類型 Description
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

具有導出的排程資訊。

回應

名稱 類型 Description
200 OK

Export

正常。 要求成功。

201 Created

Export

已建立。

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

名稱 Description
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"
          ]
        }
      }
    }
  }
}

定義

名稱 Description
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。 這可讓您將成本匯出至任何租使用者中的記憶體帳戶。 您應該使用 Service/Container/Object 資源類型和讀取/寫入/刪除/清單/新增/建立許可權 (來建立 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

匯出的類型。 請注意,『Usage』 相當於 『ActualCost』,而且適用於尚未提供服務保留費用或分攤數據的導出。

FormatType

要傳遞的導出格式。 目前僅支援 『Csv』。

GranularityType

匯出中數據列的數據粒度。 目前僅支援 「每日」。

RecurrenceType

排程週期。

StatusType

匯出排程的狀態。 如果為「非使用中」,則導出的排程會暫停。

SystemAssignedServiceIdentity

受控服務識別 (系統指派或無)

SystemAssignedServiceIdentityType

受控服務識別的類型 (系統指派或無) 。

TimeframeType

提取匯出數據的時間範圍。 如果為自定義,則必須提供特定的時間週期。

CommonExportProperties

導出的通用屬性。

名稱 類型 Description
definition

ExportDefinition

具有導出的定義。

deliveryInfo

ExportDeliveryInfo

具有導出的傳遞資訊。

format

FormatType

要傳遞的導出格式。 目前僅支援 『Csv』。

nextRunTimeEstimate

string

如果導出具有作用中的排程,請提供下一個運行時間的估計值。

partitionData

boolean

如果設定為 true,匯出的數據會依大小分割,並放在 Blob 目錄中,以及指令清單檔。 注意:此選項目前僅適用於 Microsoft 客戶合約 商務範圍。

runHistory

ExportExecutionListResult

如果已要求,則具有匯出的最新執行歷程記錄。

ErrorDetails

錯誤的詳細數據。

名稱 類型 Description
code

string

錯誤碼。

message

string

指出作業失敗原因的錯誤訊息。

ErrorResponse

錯誤回應表示服務無法處理傳入要求。 錯誤訊息中會提供原因。

某些錯誤回應:

  • 429 TooManyRequests - 要求已節流。 等候 「x-ms-ratelimit-microsoft.consumption-retry-after」 標頭中指定的時間後重試。

  • 503 ServiceUnavailable - 服務暫時無法使用。 請在等候「Retry-After」標頭中指定的時間之後重試。

名稱 類型 Description
error

ErrorDetails

錯誤的詳細數據。

ExecutionStatus

匯出執行的最後一個已知狀態。

名稱 類型 Description
Completed

string

DataNotAvailable

string

Failed

string

InProgress

string

NewDataNotAvailable

string

Queued

string

Timeout

string

ExecutionType

匯出執行的型別。

名稱 類型 Description
OnDemand

string

Scheduled

string

Export

匯出資源。

名稱 類型 Description
eTag

string

資源的 eTag。 若要處理並行更新案例,此字段將用來判斷使用者是否要更新最新版本。

id

string

資源標識碼。

identity

SystemAssignedServiceIdentity

與 Export 相關聯的受控識別

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

匯出中數據的定義。

名稱 類型 Description
configuration

ExportDatasetConfiguration

匯出數據集組態。

granularity

GranularityType

匯出中的數據列粒度。 目前僅支援 「每日」。

ExportDatasetConfiguration

匯出數據集組態。 允許選取匯出的數據行。 如果未提供,匯出將會包含所有可用的數據行。

名稱 類型 Description
columns

string[]

要包含在匯出中的數據行名稱陣列。 如果未提供,匯出將會包含所有可用的數據行。 可用的數據行可能會因客戶通道而有所不同, (請參閱範例) 。

ExportDefinition

匯出的定義。

名稱 類型 Description
dataSet

ExportDataset

匯出中數據的定義。

timePeriod

ExportTimePeriod

具有提取匯出數據的時間週期。

timeframe

TimeframeType

提取匯出數據的時間範圍。 如果為自定義,則必須提供特定的時間週期。

type

ExportType

匯出的類型。 請注意,『Usage』 相當於 『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。 這可讓您將成本匯出至任何租使用者中的記憶體帳戶。 您應該使用 Service/Container/Object 資源類型和讀取/寫入/刪除/清單/新增/建立許可權 (來建立 Blob 服務的 SAS 令牌,以取得詳細資訊,請參閱 https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ) 。

名稱 類型 Description
container

string

將上傳導出的容器名稱。 如果容器不存在,則會建立它。

resourceId

string

將傳遞導出之記憶體帳戶的資源標識碼。 如果指定 sasToken 和 storageAccount,則不需要這樣做。

rootFolderPath

string

將上傳導出的目錄名稱。

sasToken

string

記憶體帳戶的SAS令牌。 針對一組受限制的 Azure 客戶,您可以指定此帳戶與 storageAccount,而不是 resourceId。 注意:這個屬性的 API 所傳回的值一律會模糊化。 傳回這個相同的模糊化值,將不會導致 SAS 令牌更新。 若要更新此值,必須指定新的SAS令牌。

storageAccount

string

將上傳導出的記憶體帳戶。 針對一組受限制的 Azure 客戶,您可以指定 sasToken,而不是 resourceId。

ExportDeliveryInfo

與導出相關聯的傳遞資訊。

名稱 類型 Description
destination

ExportDeliveryDestination

具有要傳遞之導出的目的地。

ExportExecutionListResult

列出導出的執行歷程記錄結果。

名稱 類型 Description
value

ExportRun[]

匯出執行的清單。

ExportRecurrencePeriod

週期排程的開始和結束日期。

名稱 類型 Description
from

string

週期的開始日期。

to

string

週期的結束日期。

ExportRun

匯出執行。

名稱 類型 Description
eTag

string

資源的 eTag。 若要處理並行更新案例,此字段將用來判斷使用者是否要更新最新版本。

id

string

資源標識碼。

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

與導出相關聯的排程。

名稱 類型 Description
recurrence

RecurrenceType

排程週期。

recurrencePeriod

ExportRecurrencePeriod

具有周期的開始和結束日期。 開始日期必須在未來。 如果存在,結束日期必須大於開始日期。

status

StatusType

匯出排程的狀態。 如果為「非使用中」,則導出的排程會暫停。

ExportTimePeriod

匯出中數據的日期範圍。 這應該只指定 timeFrame 設定為 『Custom』。 日期範圍上限為 3 個月。

名稱 類型 Description
from

string

匯出數據的開始日期。

to

string

匯出數據的結束日期。

ExportType

匯出的類型。 請注意,『Usage』 相當於 『ActualCost』,而且適用於尚未提供服務保留費用或分攤數據的導出。

名稱 類型 Description
ActualCost

string

AmortizedCost

string

Usage

string

FormatType

要傳遞的導出格式。 目前僅支援 『Csv』。

名稱 類型 Description
Csv

string

GranularityType

匯出中數據列的數據粒度。 目前僅支援 「每日」。

名稱 類型 Description
Daily

string

RecurrenceType

排程週期。

名稱 類型 Description
Annually

string

Daily

string

Monthly

string

Weekly

string

StatusType

匯出排程的狀態。 如果為「非使用中」,則導出的排程會暫停。

名稱 類型 Description
Active

string

Inactive

string

SystemAssignedServiceIdentity

受控服務識別 (系統指派或無)

名稱 類型 Description
principalId

string

系統指派之身分識別的服務主體標識符。 此屬性只會針對系統指派的身分識別提供。

tenantId

string

系統指派身分識別的租用戶標識碼。 此屬性只會針對系統指派的身分識別提供。

type

SystemAssignedServiceIdentityType

受控服務識別的類型 (系統指派或無) 。

SystemAssignedServiceIdentityType

受控服務識別的類型 (系統指派或無) 。

名稱 類型 Description
None

string

SystemAssigned

string

TimeframeType

提取匯出數據的時間範圍。 如果為自定義,則必須提供特定的時間週期。

名稱 類型 Description
BillingMonthToDate

string

Custom

string

MonthToDate

string

TheLastBillingMonth

string

TheLastMonth

string

WeekToDate

string