0

For my current Python project I' using the Microsoft Azure SDK for Python. I want to copy a specific blob from one container path to another and tested already some options, described here.

Overall they are basically "working", but unfortunately the new_blob.start_copy_from_url(source_blob_url) command always leads to an erorr: ErrorCode:CannotVerifyCopySource. Is someone getting the same error message here, or has an idea, how to solve it?

I was also trying to modify the source_blob_url as a sas-token, but still doesn't work. I have the feeling that there is some connection to the access levels of the storage account, but so far I wasn't able to figure it out. Hopefully someone here can help me.

Alex
  • 11
  • 4
  • Does this answer your question? [Python sdk copy blob from container to container](https://stackoverflow.com/questions/69254321/python-sdk-copy-blob-from-container-to-container) – Ecstasy Jul 05 '22 at 06:46
  • [start_copy_from_url can't specify from Append to Block](https://github.com/Azure/azure-sdk-for-python/issues/8943), [Copy blob using SAS from user delegation key](https://github.com/Azure/azure-sdk-for-python/issues/18481) and [generate_shared_access_signature for blob service client is broken](https://github.com/Azure/azure-sdk-for-python/issues/8344) – Ecstasy Jul 05 '22 at 06:52
  • 1
    Hey, yeah! No it worked ;) The difference to my code was, that I used the blob storage sas_token from the Azure website, instead of generating it directly for the blob client with the azure function. This tokens are slightly different and because of that, the permissions are not the same. – Alex Jul 05 '22 at 07:45

1 Answers1

0

Is someone getting the same error message here, or has an idea, how to solve it?

As you have mentioned you might be receiving this error due to permissions while including the SAS Token.

The difference to my code was, that I used the blob storage sas_token from the Azure website, instead of generating it directly for the blob client with the azure function.

  • In order to allow access to certain areas of your storage account, a SAS is generated by default with a number of permissions such as read/write, services, resource type, Start and expiration date/time, and Allowed IP addresses, etc.
  • It's not that you always need to generate directly for the blob client with the azure function but you can generate one from the portal too by allowing the permissions.

enter image description here

REFERENCES: Grant limited access to Azure Storage resources using SAS - MSFT Document

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18