Skip to content

fix(services/azfile): authorize rename source with the configured SAS token - #8432

Open
YuangGao wants to merge 1 commit into
apache:mainfrom
YuangGao:fix/azfile-sas-rename
Open

YuangGao wants to merge 1 commit into
apache:mainfrom
YuangGao:fix/azfile-sas-rename

Conversation

@YuangGao

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A.

Rationale for this change

With a SAS token, azfile rename fails with 403 AuthorizationFailure: x-ms-file-rename-source carries the bare source URL, and Azure Files authorizes the source separately from the request URI, which is the only place the SAS gets appended. The Azure Java SDK appends the SAS to the rename source for the same reason (ShareFileClient#renameWithResponse).

What changes are included in this PR?

  • Append the configured sas_token to the rename source URL.

Verified against a real Azure Files share: with a config SAS token, the 4 rename behavior tests fail on main with 403 and pass here (116/116); config account key passes on both. A SAS token from the environment is not covered, since azfile only reads credentials from the environment after #8423.

Are there any user-facing changes?

azfile rename now works with a SAS token.

Breaking changes

AI Usage Statement

AI-assisted implementation.

@YuangGao
YuangGao requested a review from Xuanwo as a code owner October 26, 2026 00:00
@github-actions github-actions Bot added releases-note/fix The PR fixes a bug or has a title that begins with "fix" services/azfile size:XS This PR changes 0-9 lines, ignoring generated files. labels Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" services/azfile size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant