Skip to content

Fixed SasBuilder.DeepCopy to Preserve all Properties#59974

Merged
nickliu-msft merged 3 commits into
Azure:mainfrom
nickliu-msft:feature/storage/SasBuilder_DeepCopy_Fix
Jun 18, 2026
Merged

Fixed SasBuilder.DeepCopy to Preserve all Properties#59974
nickliu-msft merged 3 commits into
Azure:mainfrom
nickliu-msft:feature/storage/SasBuilder_DeepCopy_Fix

Conversation

@nickliu-msft

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings June 16, 2026 21:20
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Jun 16, 2026

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 fixes a regression in Storage SAS convenience methods where the SDK deep-copied *SasBuilder instances but failed to preserve identity-binding/request-pin properties (e.g., DelegatedUserObjectId, RequestHeaders, RequestQueryParameters). The result was that GenerateUserDelegationSasUri (and for Blobs/DataLake also GenerateSasUri) could silently ignore those builder settings.

Changes:

  • Update DeepCopy implementations for Queue/Share/DataLake/Blob SAS builders to preserve DelegatedUserObjectId, and for Blob/DataLake also clone RequestHeaders/RequestQueryParameters.
  • Add recorded tests asserting client-generated SAS query strings match ToSasQueryParameters(...) output and include the expected parameters.
  • Add changelog entries describing the fix (with a suggested wording adjustment for Blobs/DataLake in review comments).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/storage/Azure.Storage.Queues/tests/QueueSasBuilderTests.cs Adds test ensuring GenerateUserDelegationSasUri preserves delegated identity binding.
sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs Copies DelegatedUserObjectId in DeepCopy.
sdk/storage/Azure.Storage.Queues/CHANGELOG.md Notes bug fix for Queue SAS convenience methods.
sdk/storage/Azure.Storage.Files.Shares/tests/FileSasBuilderTests.cs Adds tests ensuring share/file GenerateUserDelegationSasUri preserves delegated identity binding.
sdk/storage/Azure.Storage.Files.Shares/src/Sas/ShareSasBuilder.cs Copies DelegatedUserObjectId in DeepCopy.
sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md Notes bug fix for Share SAS convenience methods.
sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeSasBuilderTests.cs Adds tests ensuring GenerateUserDelegationSasUri preserves delegated identity binding + request pins.
sdk/storage/Azure.Storage.Files.DataLake/src/Sas/DataLakeSasBuilder.cs Copies DelegatedUserObjectId and clones request pin dictionaries in DeepCopy.
sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md Notes bug fix for Data Lake SAS convenience methods (needs minor wording adjustment per comment).
sdk/storage/Azure.Storage.Blobs/tests/BlobSasBuilderTests.cs Adds tests ensuring GenerateUserDelegationSasUri preserves delegated identity binding + request pins.
sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs Copies DelegatedUserObjectId and clones request pin dictionaries in DeepCopy.
sdk/storage/Azure.Storage.Blobs/CHANGELOG.md Notes bug fix for Blob SAS convenience methods (needs minor wording adjustment per comment).

Comment thread sdk/storage/Azure.Storage.Blobs/CHANGELOG.md Outdated
Comment thread sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md Outdated
@nickliu-msft nickliu-msft merged commit b2d010d into Azure:main Jun 18, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants