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

[QUERY] Listing UsageDetails and Marketplaces by billing period #36876

Closed
NovaWasTaKenn opened this issue Jun 7, 2023 · 12 comments
Closed

[QUERY] Listing UsageDetails and Marketplaces by billing period #36876

NovaWasTaKenn opened this issue Jun 7, 2023 · 12 comments
Assignees
Labels
Consumption - Billing All issues in consumption where billing/price-related data is shown. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@NovaWasTaKenn
Copy link

Library name and version

Azure.ResourceManager.Consumption v1.6

Query/Question

I need a replacement for some function in Microsoft.Azure.Management.Consumption that are deprecated.

The functions I need :
ConsumptionManagementClient.UsageDetails.ListByPeriodAsync ConsumptionManagementClient.Marketplaces..ListByBillingPeriodAsync

I've looked into Azure.ResoureManager.Consumption that is listed as the replacement Microsoft.Azure.Management.Consumption, I also looked at CostManagement but I haven't been able to functions that return the same thing and work in the same way. I saw a ticket talking about Quota for Usage so I will look into that.

Environment

No response

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 7, 2023
@jsquire jsquire added Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Consumption - Billing All issues in consumption where billing/price-related data is shown. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jun 7, 2023
@jsquire
Copy link
Member

jsquire commented Jun 7, 2023

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@NovaWasTaKenn
Copy link
Author

I can see the functions I need in the github :

ConsumptionExtensions.GetConsumptionUsageDetailsAsync and ConsumptionExtensions.GetConsumptionMarketPlacesAsync

But they are not visible in the documentation or the version 1.0.1 of the Azure.ResourceManager.Consumption NuGet package

@mcgallan
Copy link
Member

mcgallan commented Jun 13, 2023

Hi @NovaWasTaKenn,
you can try browsing this documentation about Usage details and marketplace,or using the updated version of NuGet Package (version.1.1.0)

@HarveyLink HarveyLink added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jun 13, 2023
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jun 13, 2023
@github-actions
Copy link

Hi @NovaWasTaKenn. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Jun 14, 2023
@NovaWasTaKenn
Copy link
Author

NovaWasTaKenn commented Jun 19, 2023

Deleted the previous comment because I am interested in the Async version of the function.
The updated version of the package has the functions I'm looking for. The one one that lists the usageDetails works well.
However, when using ConsumptionExtensions.GetConsumptionMarketPlacesAsync, that is the function I need to list the marketplaces, I get this exception :
image

With this stacktrace :
"at System.Text.Json.JsonElement.GetGuid()
at Azure.ResourceManager.Consumption.Models.ConsumptionMarketplace.DeserializeConsumptionMarketplace(JsonElement element)
at Azure.Core.PageableHelpers.PageableImplementation1.CreatePage(Response response, String& nextLink) at Azure.Core.PageableHelpers.PageableImplementation1.d__16.MoveNext()
at Azure.Core.PageableHelpers.PageableImplementation1.<AsPagesAsync>d__16.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token) at System.Runtime.CompilerServices.ValueTaskAwaiter1.GetResult()
at Program.<

$>d__0.MoveNext() in C:\Users\user\source\repos\ConsoleApp1\ConsoleApp1\Program.cs :ligne 29
at Program.<$>d__0.MoveNext() in C:\Users\user\source\repos\ConsoleApp1\ConsoleApp1\Program.cs :ligne 29"

The code I use is from a microsoft article on iterating over pageable and it works for the function ConsumptionExtensions.GetConsumptionUsageDetailsAsync so I guess the problem comes from ConsumptionExtensions.GetConsumptionMarketPlacesAsync
Thanks in advance for the help !

@HarveyLink HarveyLink assigned live1206 and unassigned HarveyLink Jun 25, 2023
@live1206
Copy link
Member

live1206 commented Jul 5, 2023

Deleted the previous comment because I am interested in the Async version of the function. The updated version of the package has the functions I'm looking for. The one one that lists the usageDetails works well. However, when using ConsumptionExtensions.GetConsumptionMarketPlacesAsync, that is the function I need to list the marketplaces, I get this exception : image

With this stacktrace : "at System.Text.Json.JsonElement.GetGuid() at Azure.ResourceManager.Consumption.Models.ConsumptionMarketplace.DeserializeConsumptionMarketplace(JsonElement element) at Azure.Core.PageableHelpers.PageableImplementation1.CreatePage(Response response, String& nextLink) at Azure.Core.PageableHelpers.PageableImplementation1.d__16.MoveNext() at Azure.Core.PageableHelpers.PageableImplementation1.<AsPagesAsync>d__16.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token) at System.Runtime.CompilerServices.ValueTaskAwaiter1.GetResult() at Program.<

$>d__0.MoveNext() in C:\Users\user\source\repos\ConsoleApp1\ConsoleApp1\Program.cs :ligne 29
at Program.<$>d__0.MoveNext() in C:\Users\user\source\repos\ConsoleApp1\ConsoleApp1\Program.cs :ligne 29"
The code I use is from a microsoft article on iterating over pageable and it works for the function ConsumptionExtensions.GetConsumptionUsageDetailsAsync so I guess the problem comes from ConsumptionExtensions.GetConsumptionMarketPlacesAsync Thanks in advance for the help !

@NovaWasTaKenn Could you help to log the service response of the API call while invoke GetConsumptionMarketPlacesAsync to see if it is a valid Guid? meterId and subscriptionGuid in the response are supposed to be Guid. Thanks!

@live1206 live1206 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jul 5, 2023
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Hi @NovaWasTaKenn. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@live1206 live1206 removed the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jul 7, 2023
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jul 7, 2023
@NovaWasTaKenn
Copy link
Author

Hello @live1206,

Sorry, I was on vacation last week, do you still need the information on the meterId and the subscriptionGuid ?

@live1206
Copy link
Member

Hello @live1206,

Sorry, I was on vacation last week, do you still need the information on the meterId and the subscriptionGuid ?

No worries.
Yes, that would be very helpful for us to trouble-shoot this issue. Thanks!

@NovaWasTaKenn
Copy link
Author

Hello @live1206,
So subscriptionGuid has this format dddddddd-dddd-dddd-dddd-dddddddddddd and the meterId is just empty.
This is the code I used with the scope for the request being the same as in my original message
image

@live1206 live1206 assigned HarveyLink and unassigned live1206 Jul 19, 2023
@live1206
Copy link
Member

Thanks @NovaWasTaKenn for the information.

@HarveyLink Empty meterId is causing error during deserialization, please help to resolve it, thanks!

@live1206
Copy link
Member

Will be fixed in next version release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Consumption - Billing All issues in consumption where billing/price-related data is shown. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

6 participants