4

I have provisioned Datalake gen2 and in C# I am looking for an option on how to move a file from one folder to another folder? With blob storage it's simple but with Datalake I am getting confused about which SDK to use and how it can be done in C#

Also, can I use SAS token generated at the container level for authentication?

Raju Rh
  • 127
  • 1
  • 9

1 Answers1

3

If you want to move a file from one folder to another folder in Azure Data Lake Gen2, please refer to the following code

public async Task<DataLakeFileClient> MoveDirectory
    (DataLakeFileSystemClient fileSystemClient)
{
    DataLakeFileClient fileClient=
         fileSystemClient.GetFileClient("<file path>");

    return await fileClient.RenameAsync("<new file path>");
}

For more details, please refer to here and here

Besides, we can use the sas token to manage azure data lake gen2 resource. Regarding how to generate sas token, please refer to here.

Jim Xu
  • 21,610
  • 2
  • 19
  • 39