CloudBlobContainer cloudSourceContainer = <Source Container> CloudBlobContainer cloudDestinationContainer = <Destination Container> var blobItems = cloudSourceContainer.ListBlobs(null, true); foreach(var blob in blobItems) { if(blob is CloudBlockBlob) { CloudBlockBlob blockBlob = blob as CloudBlockBlob; CloudBlockBlob destBlob = cloudDestinationContainer.GetBlockBlobReference(blockBlob.Name); destBlob.StartCopy(blockBlob); } }
I use above code to copy blobs from one container to another container(in different storage account), it gives me an error(The remote server returned an error: (404) Not Found. --- The specified resource does not exist.)
I checked, if the public access type of source container is Container or Blob, then these code work fine. But the question is, in my situation both source container and destination container are only private access type. in the request sent to Azure, it only has the shared key about destination storage account(or container), but no shared key information about the source storage account.
So, What's the correct way to copy blobs when both source and destination container are only with private access type, with Azure Storage Library?