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

[BUG] Azure Billing Reservation Data type mismatch. InstanceFlexibility is being returned as 0 from Azure #48199

Open
kkgunturu opened this issue Feb 10, 2025 · 1 comment
Assignees
Labels
Billing 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

@kkgunturu
Copy link

kkgunturu commented Feb 10, 2025

Library name and version

Azure.ResourceManager.Billing[1.2.0]

Describe the bug

Class: public class BillingAccountResource : ArmResource, IJsonModel, IPersistableModel

Method: public virtual AsyncPageable GetReservationsAsync(BillingAccountResourceGetReservationsOptions options, CancellationToken cancellationToken = default);

This method fails during deserialization since some of the reservations come with "instanceFlexibility":0 instead of string (“On”, “Off”,”NotSupported”). This is a blocker.

Here is a resourceId for debug purpose: /providers/Microsoft.Billing/billingAccounts/56426788/reservationOrders/4c5428a8-7662-4966-abd3-eb4dea7b8db6/reservations/2cc525ca-e7e5-4baa-b987-b22b19f01f86

"message": "The requested operation requires an element of type 'String', but the target element has type 'Number'.",
"stack_trace": " at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)\n at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)\n at Azure.ResourceManager.Billing.BillingReservationData.DeserializeBillingReservationData(JsonElement element, ModelReaderWriterOptions options)\n at Azure.ResourceManager.Billing.BillingAccountResource.<>c__DisplayClass104_0.b__2(JsonElement e)\n at Azure.Core.PageableHelpers.PageableImplementation`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()

Expected behavior

We should be able to deserialize the BillingReservationData and successfully run the GetReservationsAsync

Actual behavior

public virtual AsyncPageable GetReservationsAsync(BillingAccountResourceGetReservationsOptions options, CancellationToken cancellationToken = default);

This method fails during deserialization since some of the reservations come with "instanceFlexibility":0 instead of string (“On”, “Off”,”NotSupported”). This is a blocker.

Here is a resourceId for debug purpose: /providers/Microsoft.Billing/billingAccounts/56426788/reservationOrders/4c5428a8-7662-4966-abd3-eb4dea7b8db6/reservations/2cc525ca-e7e5-4baa-b987-b22b19f01f86

"message": "The requested operation requires an element of type 'String', but the target element has type 'Number'.",
"stack_trace": " at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)\n at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)\n at Azure.ResourceManager.Billing.BillingReservationData.DeserializeBillingReservationData(JsonElement element, ModelReaderWriterOptions options)\n at Azure.ResourceManager.Billing.BillingAccountResource.<>c__DisplayClass104_0.b__2(JsonElement e)\n at Azure.Core.PageableHelpers.PageableImplementation`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()

Reproduction Steps

public virtual AsyncPageable GetReservationsAsync(BillingAccountResourceGetReservationsOptions options, CancellationToken cancellationToken = default);

This method fails during deserialization since some of the reservations come with "instanceFlexibility":0 instead of string (“On”, “Off”,”NotSupported”). This is a blocker.

Here is a resourceId for debug purpose: /providers/Microsoft.Billing/billingAccounts/56426788/reservationOrders/4c5428a8-7662-4966-abd3-eb4dea7b8db6/reservations/2cc525ca-e7e5-4baa-b987-b22b19f01f86

Environment

Prod

@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 Feb 10, 2025
@jsquire jsquire added Billing 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 and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Feb 10, 2025
@jsquire
Copy link
Member

jsquire commented Feb 10, 2025

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

@mcgallan mcgallan assigned mcgallan and unassigned ArthurMa1978 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Billing 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

4 participants