Comments (6)
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.
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.
tested same command using 0.30.0
confirmed issue is resolved.
Thanks
from azure-cost-cli.
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.
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.
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)
- Async fetching of cost data HOT 2
- From parameter ignored HOT 2
- Forecast causing crash on custom timeframe HOT 2
- unable to see cost by servicename, location and resourcegroup HOT 7
- unable to install "dotnet tool install --global azure-cost-cli". HOT 13
- 400 (Bad Request) when attempting to use CostByResource HOT 3
- [Bug] image not displayed HOT 11
- [question] change report currency HOT 6
- [question] how to get report by one resource group HOT 3
- Problem with installation HOT 5
- [feature request] filter results by 1 resource group including tags HOT 5
- Unable to use the --from --to option when --timeframe is set to Custom HOT 4
- Deserialization issue when calling dailyCost and output to Json HOT 2
- Show (un)utilized reservations
- Analyse budgets
- Unable to install azure-cost-cli HOT 3
- Question. Can I iterate all subscriptions on a tenant with azure-cost-cli and get a CSV with their consumption? HOT 10
- 401 unauthorized HOT 3
- Savings analysis DevTest/Savings plan/Reservations HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-cost-cli.