[BUG] Copy blob to another container with Uri
See original GitHub issueDescribe the bug Hello, I’m trying copy Append Blob to another container in same Storage account.
What im doing:
- Generate SAS
return _client.GetBlobBaseClient(fileName).GenerateSasUri(BlobSasPermissions.Read, DateTimeOffset.Now.AddMinutes(1));
Uri is ok i can download it by browser.
- 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: Everything works perfect and blob is copied.
After i change to:
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)
- Create storage account with 2 containers.
- Select Allow access from: Selected networks in container configuration
- 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:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@jrywin We are looking into it and get back to you.
Please let us know if you need further assistance.