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