Fixed SasBuilder.DeepCopy to Preserve all Properties#59974
Merged
nickliu-msft merged 3 commits intoJun 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
DeepCopyimplementations for Queue/Share/DataLake/Blob SAS builders to preserveDelegatedUserObjectId, and for Blob/DataLake also cloneRequestHeaders/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). |
jalauzon-msft
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://portal.microsofticm.com/imp/v5/incidents/details/31000000630142/summary