0
votes

I am trying to copy a page blob in one storage account to another storage account using .net API startCopy. Both storage accounts are standard type and blob exists in source location. I am getting "cannotverifysourcepath" error with below exception details.

I was hoping that startcopy API works to copy from account to another. Can anyone please help me to figure out what's the issue here?

Exception- Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.StartCopy(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob.StartCopy(CloudPageBlob source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext)
Request Information
RequestID:1a82f5b6-0001-008f-7328-26bec1000000
RequestDate:Fri, 14 Oct 2016 14:35:31 GMT
StatusMessage:The specified resource does not exist.
ErrorCode:CannotVerifyCopySource
2
All you included is your stack trace, not the actual call you made. Please edit to show how you're calling StartCopy(). (obviously obscure the real storage account name / key). Also, please clarify how you confirmed the source path is valid.David Makogon

2 Answers

1
votes

For copying blob across storage accounts, source blob must be publicly accessible. Please check the ACL on the source blob container and see if it is Private.

If the source blob container's ACL is Private, there are two possible solutions:

  1. Create a Shared Access Signature (SAS) on the source blob with at least Read permission and an expiry date of at least 15 days and use that SAS URL (blob URL + SAS token) as copy source.
  2. Not recommended, but you can change the ACL of the source blob container to Blob. This will make the source blob publicly accessible. Your code should work as is in that case.
0
votes

You can try using the data movement library. Specifically:

await TransferManager.CopyAsync(source, target, false);

The boolean parameter specifies whether or not this is a service-side asynchronous copy. If it is, the local task may complete before the copy is complete.

I have verified that this works when source and target are in different accounts and both access policies are 'private.'