Skip to content

[Storage Account] Fix for issue #59323 - #59438

Merged
Minghao Chen (HarveyLink) merged 2 commits into
Azure:mainfrom
HarveyLink:issuefix
Jun 2, 2026
Merged

[Storage Account] Fix for issue #59323#59438
Minghao Chen (HarveyLink) merged 2 commits into
Azure:mainfrom
HarveyLink:issuefix

Conversation

@HarveyLink

Copy link
Copy Markdown
Member

Contributing to the Azure SDK

Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.

For specific information about pull request etiquette and best practices, see this section.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #59323 in Azure.ResourceManager.Storage by making StorageAccountResourceAccessRule.TenantId deserialization tolerant of empty/whitespace/invalid GUID strings returned by the service, preventing GET/list operations from failing due to malformed tenantId values.

Changes:

  • Added a TypeSpec customization deserialization hook to safely parse tenantId into Guid? (fallback to null on invalid input).
  • Updated generated model deserialization to use the new hook.
  • Added NUnit tests covering valid/empty/whitespace/null/invalid tenantId JSON inputs and documented the fix in the changelog.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
sdk/storage/Azure.ResourceManager.Storage/tests/Tests/StorageAccountResourceAccessRuleSerializationTests.cs Adds coverage to ensure deserialization is tolerant to empty/invalid tenantId values.
sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/StorageAccountResourceAccessRule.Serialization.cs Switches tenantId parsing to the customization hook to avoid exceptions on malformed values.
sdk/storage/Azure.ResourceManager.Storage/src/Customize/Models/StorageAccountResourceAccessRule.cs Introduces DeserializeNullableGuid hook via CodeGenSerialization to safely parse tenantId.
sdk/storage/Azure.ResourceManager.Storage/CHANGELOG.md Records the bug fix under the current unreleased version.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm this change would cause the SDK to omit the value returned by the service if it is not really a guid.
Given the property name tenantId, I think we could be confident that this is a case that the service returns an empty string here, not returning some random string values.
If it is the later case, this fix is not quite good and instead we should create a new property with string type to hold the real value.

Anyhow, this LGTM

@blueww Wei Wei (blueww) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
The fix is aligned with another fix for same GUID parse issue before #56904. That fix works well for customer and don't take an regression customer issue.

@HarveyLink
Minghao Chen (HarveyLink) merged commit dd8d667 into Azure:main Jun 2, 2026
27 checks passed
@HarveyLink
Minghao Chen (HarveyLink) deleted the issuefix branch June 2, 2026 02:10
mcgallan pushed a commit to mcgallan/azure-sdk-for-net that referenced this pull request Jun 11, 2026
* Fix

* Update StorageAccountResourceAccessRule.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mgmt This issue is related to a management-plane library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StorageAccountResourceAccessRule.tenantId deserialization fails with FormatException when value is not a valid GUID

5 participants