Skip to content

[BUG] Billing Role Assignment deserialization fails when createdByPrincipalTenantId is empty #47341

@noah-prosperops

Description

@noah-prosperops

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:

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.

Environment

.NET 8

Metadata

Metadata

Assignees

Labels

BillingMgmtThis issue is related to a management package.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions