Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inclusion of date as part costByResource output #183

Open
mlnraop opened this issue Oct 23, 2024 · 4 comments
Open

Inclusion of date as part costByResource output #183

mlnraop opened this issue Oct 23, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mlnraop
Copy link

mlnraop commented Oct 23, 2024

Hi,
Would like to capture the the date of the spend as part "azure-cost costByResource -s " csv export.
While this is possible with individual date export, not having the date in output csv is causing bit of an issue in analysis.

Appreciate if there is method added to include the date as one additional item against each line of spend.

Thanks
Narayana

Copy link

welcome bot commented Oct 23, 2024

Thanks for opening your first issue! Reports like these help improve the project!

@mivano
Copy link
Owner

mivano commented Oct 24, 2024

As it is the cost by resource, the data returned is from the period specified in the filter. So there is no explicit field in the dataset returned from the Azure Cost API. So just to clarify; you would like to see the period the data applies to?

so like:

fromdate, todate, 2.57400000,2.86814174,/subscriptions/e5291ea1-ae55-4ef6-a4ad-7dc9ca4384b3/resourcegroups/temp-vm/providers/microsoft.network/publicipaddresses/tempvmtestregion-ip,microsoft.network/publicipaddresses,EU West,Usage,temp-vm,Azure,Virtual Network,IP Addresses,Standard IPv4 Static Public IP,,EUR

As it looks like, I cannot directly get it, so need to infer it from the date range used. But I will have to further dive into it.

@mivano mivano added the enhancement New feature or request label Oct 24, 2024
@mlnraop
Copy link
Author

mlnraop commented Oct 25, 2024 via email

@mivano
Copy link
Owner

mivano commented Nov 6, 2024

Your suggestion is indeed one way to use the system; loop through each date and fetch the data for a period (day). Then you know for sure that the cost is per that period. And then add the date used as a post step to your processing.

You might also be able to use the dailyCost and use a dimension like resourceid. And then post-process the data.

I m a bit reluctant to add the date to the CSV output as I simply do not get it from the API and it is implicit from the date range provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants