title: Copy Blob in Azure Blob Storage using Java v12 SDK
body: <p>My Application is in a Kubernetes cluster and I'm using <a href="https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/storage/azure-storage-blob#azure-storage-blob-client-library-for-java" rel="nofollow noreferrer">Java v12 SDK</a> to interact with the Blob Storage. To authorize against Blob Storage I'm using Managed Identities.</p>
  <p>My application needs to copy blobs within one container. I haven't found any particular <a href="https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/storage/azure-storage-blob#examples" rel="nofollow noreferrer">recommendations or examples</a> of how SDK should be used to do the copy.</p>
  <p>I figured that the following approach works when I'm working with the emulator</p>
  <pre><code>copyBlobClient.copyFromUrl(sourceBlobClient.getBlobUrl());
  </code></pre>
  <p>However, when this gets executed in the cluster I get the following error</p>
  <pre><code>&lt;Error&gt;
     &lt;Code&gt;CannotVerifyCopySource&lt;/Code&gt;
     &lt;Message&gt;The specified resource does not exist. RequestId: __ Time: __ &lt;/Message&gt;
  &lt;/Error&gt; 
  </code></pre>
  <p>Message says &quot;resource does not exist&quot; but the blob is clearly there. My container has private access, though.</p>
  <p>Now when I change the public access level to &quot;Blob(anonymous read access for blobs only)&quot; everything works as excepted. However, public access not acceptable to me.</p>
  <p><strong>Main question - what are the right ways to implement copy blob using Java v12 SDK.</strong></p>
  <p>What I could miss or misconfigured in my situation?</p>
  <p>And the last is the error message itself. There is a part which says &quot;CannotVerifyCopySource&quot; which kind of helps you understand that there is something with access, but the message part is clearly misleading. Shouldn't it be more explicit about the error?</p>