3

I'm using Azure SDK (Java) to create directory, upload files, move files in ADLSGEN2.

My input are very simple, it look like:

path : /path/to/fileOrFolder

But I got following Error:

com.azure.storage.file.datalake.models.DatalakeStorageException: Status Error code 400: The request URI is invalid ...
tdebroc
  • 1,436
  • 13
  • 28

1 Answers1

6

I share the solution here, as it cost me several hours to 1 day of debugging ... for just this:

The problem was that I had a leading Slash in front of the path.

Solution: Remove the first slash at the beginning of the path:

Replace

/path/to/fileOrFolder

by

path/to/fileOrFolder

It's the same pattern for all action : upload, create directory, rename, delete, ...

I think Azure SDK should do the normalization itself or have a more comprehensive error message ...

tdebroc
  • 1,436
  • 13
  • 28
  • Same with trailing "/", e.g. DataLakeServiceClient.getFileSystemClient("blobname"); DataLakeFileSystemClient.getDirectoryClient("mypath/") fails with same error. Must be "mypath" without the trailing slash. – beaudet Jul 11 '22 at 14:19