This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.57k
stars
4.82k
forks
source link
[BUG] Billing Role Assignment deserialization fails when createdByPrincipalTenantId is empty #47341
System.FormatException
One of the identified items was in an invalid format.
This occurs on this line in the SDK's deserialization of the createdByPrincipalTenantId property. It expects a GUID, but the value returned by API is actually an empty string in the failure scenario.
Expected behavior
The operation should always succeed for normal requests to the Azure API. In the case of an empty string for createdByPrincipalTenantId, the operation should complete and the result should reflect the actual value (we don't have an opinion on whether this would be empty GUID, null, or otherwise).
Actual behavior
System.FormatException is thrown with message One of the identified items was in an invalid format.
Reproduction Steps
Query an environment where role assignments exist with empty createdByPrincipalTenantId value. Perform SDK GetAllAsync() and observe the thrown exception.
Library name and version
Azure.ResourceManager.Billing 1.2.0
Describe the bug
When calling GetBillingProfileRoleAssignments().GetAllAsync() to list role assignments for a billing profile, we are observing in some environments an exception during this operation:
This occurs on this line in the SDK's deserialization of the
createdByPrincipalTenantId
property. It expects a GUID, but the value returned by API is actually an empty string in the failure scenario.Expected behavior
The operation should always succeed for normal requests to the Azure API. In the case of an empty string for
createdByPrincipalTenantId
, the operation should complete and the result should reflect the actual value (we don't have an opinion on whether this would be empty GUID, null, or otherwise).Actual behavior
System.FormatException
is thrown with messageOne of the identified items was in an invalid format.
Reproduction Steps
Query an environment where role assignments exist with empty
createdByPrincipalTenantId
value. Perform SDKGetAllAsync()
and observe the thrown exception.Environment
.NET 8