Azure table "azure_costmanagement_view_queries" "Error 400 Bad Request Invalid query definition, Dataset is invalid or not supplied"

Hi I’m facing a issue with the " azure_costmanagement_view_queries table.
The azure_costmanagement_views table retrieves the data correctly

"{""kpis"": [{""id"": ""COST_NAVIGATOR.BUDGET_OPTIONS.NONE"", ""type"": ""Budget"", ""enabled"": true}, {""type"": ""Forecast"", ""enabled"": true}], ""chart"": ""Area"", ""query"": {""type"": ""ActualCost"", ""dataSet"": {""sorting"": [{""name"": ""UsageDate"", ""direction"": ""Ascending""}], ""grouping"": [{""name"": ""ResourceId"", ""type"": ""Dimension""}], ""aggregation"": {""totalCost"": {""name"": ""Cost"", ""function"": ""Sum""}, ""totalCostUSD"": {""name"": ""CostUSD"", ""function"": ""Sum""}}, ""granularity"": ""Daily""}, ""timeframe"": ""None"", ""includeMonetaryCommitment"": false}, ""scope"": ""subscriptions/<sub_id>"", ""metric"": ""ActualCost"", ""pivots"": [{""name"": ""ServiceName"", ""type"": ""Dimension""}, {""name"": ""ResourceLocation"", ""type"": ""Dimension""}, {""name"": ""ResourceGroupName"", ""type"": ""Dimension""}], ""currency"": ""USD"", ""createdOn"": ""2024-12-03T07:24:30.6487667Z"", ""dateRange"": ""Last7Days"", ""modifiedOn"": ""2024-12-03T16:12:22.6561525Z"", ""accumulated"": ""False"", ""displayName"": ""cost-view""}"

But in the cloudquery.log file during the sync, the request to the azure_costmanagement_view_queries is showing the following:

ERR table resolver finished with error error="POST https://management.azure.com/subscriptions/<sub_id>/providers/Microsoft.CostManagement/query\n--------------------------------------------------------------------------------\nRESPONSE 400: 400 Bad Request\nERROR CODE: BadRequest\n--------------------------------------------------------------------------------\n{\n  \"error\": {\n    \"code\": \"BadRequest\",\n    \"message\": \"Invalid query definition, Dataset is invalid or not supplied. (Request ID: a08a83de-99f4-4064-bb41-cd43c4d69c5e)\"\n  }\n}\n--------------------------------------------------------------------------------\n" client=subscriptions/<sub_id>invocation_id=7452481d-725c-4550-a75c-84bffcbc92ba module=azure-source table=azure_costmanagement_view_queries

I noticed that the field “dataset” in the destination in the table “azure_costmanagement_views” appears as “dataSet”, this will have to do with this error?.
I’m using the Azure plugin v16.0.0.
Thanks in advance!.

Hi @Jose_Pablo_Arancibia thanks for reporting. This looks like a bug in the Azure source plugin, we’ll try to reproduce and report back

1 Like

Thanks @erez for your replay!. I will keep an eye out in case you need more information.