azure-cli-extensions: costmanagement : Invalid definition type 'AmortizedCost'; valid values: 'Usage'.

Extension name

costmanagement

$ az version
{
  "azure-cli": "2.8.0",
  "azure-cli-command-modules-nspkg": "2.0.3",
  "azure-cli-core": "2.8.0",
  "azure-cli-nspkg": "3.0.4",
  "azure-cli-telemetry": "1.0.4",
  "extensions": {
    "costmanagement": "0.1.0"
  }
}

Description of issue (in as much detail as possible)

I am running following command to create export job for AmortizedCost.

az costmanagement export create --name "exportTest" --type "AmortizedCost" --timeframe "WeekToDate" --storage-container="export" --storage-account-id="/subscriptions/XXXX/resourceGroups/XXXXX/providers/Microsoft.Storage/storageAccounts/XXXX" --storage-directory="test" --scope "/subscriptions/XXXX/"

But I am getting following error

cli.azure.cli.core.util : (400) Request properties validation failed: Invalid definition type 'AmortizedCost'; valid values: 'Usage'.
 (Request ID: 389bfa8d-033c-44a8-8a46-00f99a98a1fa)
(400) Request properties validation failed: Invalid definition type 'AmortizedCost'; valid values: 'Usage'.
 (Request ID: 389bfa8d-033c-44a8-8a46-00f99a98a1fa)

Can someone help here, please?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (4 by maintainers)

Most upvoted comments

I still have the same issue when using Terraform automate creating cost report export. Does anyone know any workaround for this one?

│ Error: updating Scoped Export (Scope: "/subscriptions/XXXXXXXXXX"
│ Export Name: "myexport"): exports.ExportsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="400" Message="Request properties validation failed: Invalid definition type 'ActualCost'; valid values: 'Usage'.\r\n (Request ID: 399323f0-d1af-4fc4-928e-f729645e2f15)"
│ 
│   with azurerm_subscription_cost_management_export.daily_cost_export,
│   on azure.tf line 48, in resource "azurerm_subscription_cost_management_export" "daily_cost_export":
│   48: resource "azurerm_subscription_cost_management_export" "daily_cost_export" {
│ 
│ updating Scoped Export (Scope: "/subscriptions/XXXXXXXXXX"
│ Export Name: "myexport"): exports.ExportsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error.
│ Status=400 Code="400" Message="Request properties validation failed: Invalid definition type 'ActualCost'; valid values: 'Usage'.\r\n (Request ID:
│ 399323f0-d1af-4fc4-928e-f729645e2f15)"

Same issue when using az costmanagement cli (version 0.2.1)

az costmanagement export create --name "quanexporttest" --type "ActualCost" --timeframe "MonthToDate" --storage-container="mycontainer" --storage-account-id="/subscriptions/XXXXXXXXXXX/resourceGroups/myresourecegroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount" --storage-directory="quaintest" --scope "subscriptions/XXXXXXXXXXXXXX"
(400) Request properties validation failed: Invalid definition type 'ActualCost'; valid values: 'Usage'.
 (Request ID: 9f68159f-89dd-4cad-b4a5-e57b2ebdc925)
Code: 400

@fl-max service team should look into this.