Azure / Azure/azure-storage-python

The sasToken in copy_source_url is needed when specify requires_sync=True in copy_blob method.

Open
#604 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
343
Forks
243
PR merge metrics
No merged PRs in 30d

Description

I used the copy_blob method to copy blobs **in the same storage account**, and both of the **containers are private**.

If I did not specify the sasToken in the copy_source_url, then an error occured, like below:

**HTTP status code=404. ErrorCode: CannotVerifyCopySource. The specified resource does not exist.**

The completed code is as below:

```
from azure.storage.blob import BlockBlobService

accountName="xxx"
accountKey="xxx"

blobs = BlockBlobService(account_name=accountName,account_key=accountKey)

#copy_source_url
copySource="https://xxxx.blob.core.windows.net/f22/gen2.JPG"

blobs.copy_blob("dest_container","dest_blob_name",copySource,requires_sync=True)
```

Some other observations:
1. if the source container is public, it works without specify sasToen
2. if the source container is private, but remove the requires_sync=True, it can work well.

Could you please let me know if it's by design or it's a bug? I cannot find any docs about it.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported copy_blob call with private containers, copy_source_url without a SAS token, and requires_sync=True. Compare it with a public source and with requires_sync omitted; done means determining whether the 404 is expected behavior or a bug and documenting or correcting that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.