Unable to rename a ADLS Gen2 directory using SAS Token

Karthikeyan Kumar 1 Reputation point Microsoft Employee
2021-01-27T11:22:48.14+00:00

Hello,
I am getting a 401 error while trying to rename a folder in ADLS Gen2 with hierarchical namespace enabled using the SDK method DataLakeDirectoryClient.RenameAsync. We are using SAS based auth and even with permissions and I am still getting a 401 error asking to authenticate.

  1. Add the attached Program.cs to a new .net core 3.1 console app
  2. Add package references Azure.Identity, Azure.Storage.Files.DataLake, Microsoft.Azure.Services.AppAuthentication
  3. Set the variables
    • storageAccountName – name of any ADLS Gen2 with hierarchical namespace enabled storage account
    • clientId, clientSecret – client credentials having access to the account used for testing
    • containerName – any existing container in the storage account.
      1. Run the program and it will fail only while trying to rename the directory while the same SAS token is able to create directory, sub directory, upload file and delete directory as well.60938-programcs.txt
Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,478 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.