GithubHelp home page GithubHelp logo

Comments (6)

vitorhrduarte avatar vitorhrduarte commented on May 26, 2024 1

It seems that the Dimension "ServiceTier" is not in the allowed list.
If exclude the --exclude-meter-details it passes.
I think this is in the ConsoleOutputFormatter.cs and in AzureCostApiRetriever.cs
If we "if (settings.ExcludeMeterDetails == false)" then there is a reference to Service Tier as a column.
Pls, forgive me for any incorrection since I am not a dev just someone that finds this awesome and need the costByResource working. :)

If we remove all refs to Service Tier in the following files:
src/CostApi/AzureCostApiRetriever.cs
src/CostApi/CostResourceItem.cs
src/OutputFormatters/ConsoleOutputFormatter.cs
src/OutputFormatters/MarkdownOutputFormatter.cs
src/OutputFormatters/TextOutputFormatter.cs

and rebuild it runs... this is not a fix is just a workaround until a proper fix is released.

from azure-cost-cli.

mivano avatar mivano commented on May 26, 2024 1

I think I found the culprit. Some conversion (https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/migrate-ea-usage-details-api#data-field-mapping) was needed. Could you please try 0.29.0 ?

from azure-cost-cli.

Daniel-Spindler-Mandalay avatar Daniel-Spindler-Mandalay commented on May 26, 2024 1

tested same command using 0.30.0
confirmed issue is resolved.
Thanks

from azure-cost-cli.

mivano avatar mivano commented on May 26, 2024

Similar issue reported here: https://www.reddit.com/r/AZURE/comments/12w3pm3/comment/jhu56ul/?utm_source=reddit&utm_medium=web2x&context=3

Tricky to troubleshoot, looks like I need to find out what is supported first.

from azure-cost-cli.

mivano avatar mivano commented on May 26, 2024

Can you run this (with the meter details) with the --debug parameter? I want to know what your quotaid says, so the type of subscription. I simply do not understand why it rejects this field. The ServiceTier should contain data like Free Plan, Dv2/DSv2 Series Windows, Tiered Block Blob etc. So I would not know why that is not available in all subscriptions. So I would like to know the type of subscription you have here.

from azure-cost-cli.

vitorhrduarte avatar vitorhrduarte commented on May 26, 2024

Here it goes:

Version: 0.28.0.0
No subscription ID specified. Trying to retrieve the default subscription ID from Azure CLI.
Default subscription ID retrieved from az cli: <<>>
Using token credential: ChainedTokenCredential to fetch a token.
Token retrieved and expires at: 6/29/2023 3:22:31 PM +00:00
Retrieving data from /subscriptions/<<>>/providers/Microsoft.CostManagement/query?api-version=2021-10-01&$top=5000 using the following payload:
{
"type": "ActualCost",
"timeframe": "BillingMonthToDate",
"timePeriod": null,
"dataSet": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "Cost",
"function": "Sum"
},
"totalCostUSD": {
"name": "CostUSD",
"function": "Sum"
}
},
"include": [
"Tags"
],
"filter": null,
"grouping": [
{
"type": "Dimension",
"name": "ResourceId"
},
{
"type": "Dimension",
"name": "ResourceType"
},
{
"type": "Dimension",
"name": "ResourceLocation"
},
{
"type": "Dimension",
"name": "ChargeType"
},
{
"type": "Dimension",
"name": "ResourceGroupName"
},
{
"type": "Dimension",
"name": "PublisherType"
},
{
"type": "Dimension",
"name": "ServiceName"
},
{
"type": "Dimension",
"name": "ServiceTier"
},
{
"type": "Dimension",
"name": "Meter"
}
]
}
}
Response status code is BadRequest and got payload size of 903
Response content: {"error":{"code":"BadRequest","message":"Invalid query definition: Invalid dataset grouping: 'ServiceTier'; valid values:
'ResourceGroup','ResourceGroupName','ResourceType','ResourceId','ResourceLocation','SubscriptionId','SubscriptionName','MeterCategory','MeterSubcategory','Meter','ServiceFamily','UnitOfMeasure','PartNumber','BillingAccountName','BillingProfileId
','BillingProfileName','InvoiceSection','InvoiceSectionId','InvoiceSectionName','Product','ResourceGuid','ChargeType','ServiceName','ProductOrderId','ProductOrderName','PublisherType','ReservationId','ReservationName','Frequency','InvoiceId','Pr
icingModel','CostAllocationRuleName','MarkupRuleName','BillingMonth','Provider','BenefitId','BenefitName','CustomerTenantId','CustomerTenantDomainName','ResellerMPNId','PartnerEarnedCreditApplied','CustomerName','PartnerName',''.\r\n\r\n
(Request ID: <<>>)"}}
Error: Response status code does not indicate success: 400 (Bad Request).

from azure-cost-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.