question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Copy blob to another container with Uri

See original GitHub issue

Describe the bug Hello, I’m trying copy Append Blob to another container in same Storage account.

What im doing:

  1. Generate SAS return _client.GetBlobBaseClient(fileName).GenerateSasUri(BlobSasPermissions.Read, DateTimeOffset.Now.AddMinutes(1));

Uri is ok i can download it by browser.

  1. Trying copy blob with SAS to another container: await _client.GetBlockBlobClient(fileName).SyncUploadFromUriAsync(uri);

Now im getting error below.

!! IMPORTANT !!

what I discovered:

If i change allow acces to: obraz Everything works perfect and blob is copied.

After i change to: obraz

Im getting error trying copy with SyncUploadFromUriAsync(uri)

Anyone know solution?

Expected behavior Copy Append Blob as Block Bock to another container in same Storage Account.

Actual behavior (include Exception or Stack Trace) Getting error from method await _client.GetBlockBlobClient(fileName).SyncUploadFromUriAsync(uri);

error:

[00:40:25 ERR] An unhandled exception has occurred while executing the request.
Azure.RequestFailedException: Copy source blob has been modified.
RequestId:d1e6198a-e01e-0099-1e14-d1a09a000000
Time:2021-11-04T00:40:19.0048413Z
Status: 409 (Copy source blob has been modified.)
ErrorCode: CannotVerifyCopySource

Content:
<?xml version="1.0" encoding="utf-8"?><Error><Code>CannotVerifyCopySource</Code><Message>Copy source blob has been modified.
RequestId:d1e6198a-e01e-0099-1e14-d1a09a000000
Time:2021-11-04T00:40:19.0048413Z</Message></Error>

Headers:
Server: Windows-Azure-Blob/1.0,Microsoft-HTTPAPI/2.0
x-ms-request-id: d1e6198a-e01e-0099-1e14-d1a09a000000
x-ms-client-request-id: 0eba79c2-804e-48f1-8354-b17909b87417
x-ms-version: 2020-10-02
x-ms-error-code: CannotVerifyCopySource
Date: Thu, 04 Nov 2021 00:40:18 GMT
Content-Length: 226
Content-Type: application/xml

   at Azure.Storage.Blobs.BlockBlobRestClient.PutBlobFromUrlAsync(Int64 contentLength, String copySource, Nullable`1 timeout, Byte[] transactionalContentMD5, String blobContentType, String blobContentEncoding, String blobContentLanguage, Byte[] blobContentMD5, String blobCacheControl, IDictionary`2 metadata, String leaseId, String blobContentDisposition, String encryptionKey, String encryptionKeySha256, Nullable`1 encryptionAlgorithm, String encryptionScope, Nullable`1 tier, Nullable`1 ifModifiedSince, Nullable`1 ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, Nullable`1 sourceIfModifiedSince, Nullable`1 sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, Byte[] sourceContentMD5, String blobTagsString, Nullable`1 copySourceBlobProperties, String copySourceAuthorization, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.Specialized.BlockBlobClient.SyncUploadFromUriInternal(Uri copySource, BlobSyncUploadFromUriOptions options, Boolean async, CancellationToken cancellationToken)
   at Azure.Storage.Blobs.Specialized.BlockBlobClient.SyncUploadFromUriAsync(Uri copySource, Boolean overwrite, CancellationToken cancellationToken)

To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. Create storage account with 2 containers.
  2. Select Allow access from: Selected networks in container configuration
  3. Try copy blob by SAS to another container

Environment:

  • Azure.Blob.Storage 12.10.0
  • .NET 5.0
  • VS 16.9.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SaurabhSharma-MSFTcommented, Nov 5, 2021

@jrywin We are looking into it and get back to you.

0reactions
amishra-devcommented, Feb 21, 2022

Please let us know if you need further assistance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to copy blobs from one container to another
I am creating a console app that copies all blobs in all containers from an account we use for production to another we...
Read more >
[BUG] Azure Storage Blob Copy across containers, doesn't ...
When I call StartCopyFromUriAsync() with the URI, the blob should copy successfully from container A to container B. Actual behavior. I recieve ...
Read more >
Copy Blob From URL (REST API) - Azure Storage
The Copy Blob From URL operation copies a blob to a destination within the storage account synchronously for source blob sizes up to...
Read more >
Copying Azure Blobs Between Containers the Quick Way
Copying between storage accounts​​ To copy between storage accounts, you still use the StartCopyAsync method, but pass the Uri of the source blob...
Read more >
Copy From Azure Blob Storage To Azure File Share - ...
Copy files from one Azure storage account to another storage account. ... URI for each service individually (blob container and file share) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found