Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Storage] DataLake Rename does not pass SAS from source to destination when appended on to the Source URL #42000

Closed
amnguye opened this issue Feb 15, 2024 · 3 comments · Fixed by #42004
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@amnguye
Copy link
Member

amnguye commented Feb 15, 2024

Library name and version

Azure.Storage.Files.DataLake 12.18.0-beta.1

Describe the bug

When using DataLakeFileClient.Rename(..) with a SAS on the URL of the Source File Client, and no SAS on the Destination Path, it will not use the source SAS.

Looks like this has been this way since version 12.12.0 of Azure.Storage.Files.DataLake.

Mitigation 1:
Create the Source Client with a AzureSasCredential.

Mitigation 2:
Pass the SAS on the destination
DataLakeFileClient destFile = await sasFileClient.RenameAsync(destinationPath: newPath + "?" + sourceSas);

Expected behavior

If source client is created with a SAS on the Uri, and then Rename is called, with the destination not having any SAS, the SAS should be passed to the destination.

Actual behavior

It will not pass the SAS to the destination.

Reproduction Steps

DataLakeSasQueryParameters sourceSas = GetNewDataLakeServiceSasCredentialsPath(fileSystemName, sourceDirectoryClient.Path, isDirectory: true);
DataLakeUriBuilder sourceUriBuilder = new DataLakeUriBuilder(sourceDirectoryClient.Uri)
{
    Sas = sourceSas
};

string destFileName = GetNewFileName();

DataLakeDirectoryClient sasDirectoryClient = InstrumentClient(new DataLakeDirectoryClient(sourceUriBuilder.ToUri(), GetOptions()));
DataLakeFileClient sasFileClient = InstrumentClient(sasDirectoryClient.GetFileClient(sourceFile.Name));

// Act
DataLakeFileClient destFile = await sasFileClient.RenameAsync(destinationPath: newPath);

Environment

n/a

@amnguye amnguye added Storage Storage Service (Queues, Blobs, Files) Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Feb 15, 2024
@amnguye amnguye self-assigned this Feb 15, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 15, 2024
@amnguye
Copy link
Member Author

amnguye commented Feb 15, 2024

This was created from an offline customer issue.

@amnguye amnguye removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 15, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 15, 2024
@amnguye
Copy link
Member Author

amnguye commented Feb 15, 2024

Let's check Share Files as well, since the same logic was used there.

Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
2 participants