Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
563 views
in Technique[技术] by (71.8m points)

azure - Copy page blob from one storage account to Another storage account using .Net API startCopy

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...