[BUG] Azure Billing Reservation Data type mismatch. InstanceFlexibility is being returned as 0 from Azure #48199
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
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
The text was updated successfully, but these errors were encountered: