Move-AzDataLakeGen2Item fails with Server failed to authenticate the request

Vaibhav Chaudhari 38,921 Reputation points Volunteer Moderator
2021-03-15T14:49:57.647+00:00

Trying to copy a file or folder within same container in ADLS Gen2.

I generated SAS key at account level, created context and could create new container, folder but can't move files or folder. Am I missing anything?

Note - If I create new context using storage account key, it works fine. But we wanted SAS based authentication.

Error: 
Move-AzDataLakeGen2Item : Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:f2739649-201f-0057-0f68-196d84000000
Time:2021-03-15T07:00:16.5814369Z
Status: 401 (Server failed to authenticate the request. Please refer to the information in the www-authenticate header.)
ErrorCode: NoAuthenticationInformation
Headers:
x-ms-error-code: NoAuthenticationInformation
x-ms-request-id: f2739649-201f-0057-0f68-196d84000000
x-ms-version: 2020-04-08
x-ms-client-request-id: da2ca9a0-b331-44c1-b8aa-2d8fd61bec44
Content-Length: 250
Content-Type: application/json;charset=utf-8
Date: Mon, 15 Mar 2021 07:00:16 GMT
Server: Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
WWW-Authenticate: REDACTED
At line:1 char:1
+ Move-AzDataLakeGen2Item -Context $ctx -FileSystem "newcontainer" -Pat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Move-AzDataLakeGen2Item], RequestFailedException
    + FullyQualifiedErrorId : RequestFailedException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.MoveAzDataLakeGen2ItemCommand

PowerShell code:

$ctx = New-AzStorageContext -StorageAccountName "myadlsgen2" -SasToken "?sv=2020-02-10&ss=b&srt=sco&sp=rwdlacx&se=2021-03-16T13:27:14Z&st=2021-03-15T05:27:14Z&spr=https&sig=..."

New-AzStorageContext -StorageAccountName "myadlsgen2" -SasToken $ctx

#below works
Get-AzDatalakeGen2FileSystem -Context $ctx -Name "vccontainer"

New-AzStorageContainer -Context $ctx -Name "newcontainer"

#below fails

Move-AzDataLakeGen2Item -Context $ctx -FileSystem "newcontainer" -Path "Newfolder/" -DestFileSystem "newcontainer" -DestPath "dir/" -Verbose
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,562 questions
{count} vote

Accepted answer
  1. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2021-04-30T16:47:58.773+00:00

    Hi @Vaibhav Chaudhari ,

    Sorry for the delay on this issue. I have received an update form product team. Here is the github work item to track this issue and product team has a shared a temporary work item in this github work item - https://github.com/Azure/azure-powershell/issues/14875

    Product team will apply a more formal fix after SDK fix this.
    After the fix, the workaround mentioned in the github might not work anymore.

    Please feel free to engage on the GitHub item if you have any further feedback.


0 additional answers

Sort by: Most helpful

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.