SAS URL on container's directory not working with sync

What is the problem you are having with rclone?

I tried to sync a local folder on an azure blob container's directory using a SAS URL, but I get an error.

Oddly enough, when I try this command, it works:

rclone lsd az:
          -1 2023-03-07 16:23:01        -1 test

Run the command 'rclone version' and share the full output of the command.

rclone v1.61.1
- os/version: darwin 13.2.1 (64 bit)
- os/kernel: 22.3.0 (x86_64)
- os/type: darwin
- os/arch: amd64
- go/version: go1.19.4
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Azureblob

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync ./localdirectory/ az: -vvvv

The rclone config contents with secrets removed.

[az]
type = azureblob
sas_url = https://account.blob.core.windows.net/test?sdd=1&se=2023-03-08T14%3A15%3A58Z&si=testcli&sig=XXX&spr=https&sr=d&st=2023-03-07T14%3A15%3A58Z&sv=2020-02-10

A log from the command with the -vv flag

2023/03/07 16:21:12 ERROR : .DS_Store: Failed to copy: can't upload to root - need a container
...
--------------------------------------------------------------------------------
RESPONSE 403: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
ERROR CODE: AuthenticationFailed
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:XXX
Time:2023-03-07T15:21:12.4213424Z</Message><AuthenticationErrorDetail>Signed Directory Depth Invalid</AuthenticationErrorDetail></Error>

hello and welcome to the forum,

in the forum, there are a number of topics about that
https://forum.rclone.org/t/rclone-azure-blob-storage-authorization-failure/30862/7

Thanks for your quick answer.
I saw it before posting the issue, but I couldn't find the solution there.

I just found the solution. When using sync, you need to specify the container/directory in the path as well. Initially I thought it was not needed as it's specify in the SAS URL.

The right command would be:

rclone sync ./localdirectory/ az:test/subfolder -vvvv

test being the container and subfolder the directory

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.