title: Azure REST API Accepted for some file types, Forbidden for other file types
body: <p>I'm using the Azure REST API to copy files from one folder to another (<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/copy-file" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/rest/api/storageservices/copy-file</a>). All files and folders are in the same account, in the same file share, uploaded by the same user account via the portal. I'm using SharedKey auth and the key is the same for all requests. The authentication portion code is from <a href="https://github.com/Azure-Samples/storage-dotnet-rest-api-with-auth.git" rel="nofollow noreferrer">https://github.com/Azure-Samples/storage-dotnet-rest-api-with-auth.git</a> and the requests are made from that code, adapted for Get/Copy requests.</p>
  <p>My problem is that attempting to copy some files results in a <strong>403 Forbidden</strong> response. This appears to be linked to the file type. The file extension is not a factor. I can copy .jpg (and .jpeg), .txt, and .pdf files. I cannot copy .exe, .mp4 or .zip files. If I rename a .exe file with a .jpg extension on my dev machine, then upload to <em>/source</em> folder via the portal, attempting to copy via the API results in a Forbidden response. File size is not a factor, I have actual .jpg files copy successfully that are larger than the problem file types.</p>
  <p>I cannot find any example or explanation for this. Testing details below.</p>
  <p>(replace [myaccount] with a string, [some guid] confirmed not null and valid guid value)</p>
  <p>Directories under my file share are:</p>
  <p>/destination</p>
  <p>/source</p>
  <p><em><strong>Test 01</strong></em>: copy th.jpeg from source to destination</p>
  <p>Request:</p>
  <pre><code>{Method: PUT, RequestUri: 'https://[myaccount].file.core.windows.net/[myshare]/destination/th.jpeg', Version: 1.1, Content: &lt;null&gt;, Headers:
  {
    x-ms-date: Wed, 27 Jan 2021 15:13:28 GMT
    x-ms-version: 2017-04-17
    x-ms-copy-source: https://[myaccount].file.core.windows.net/[myshare]/source/th.jpeg
    Authorization: SharedKey [myaccount]:18sCuTcbEOA5TLC11hCEH0pkK93Ln/Wk1BSRy0ytEAA=
    Request-Id: [value is same as failed requests]
  }}
  </code></pre>
  <p>Response:</p>
  <pre><code>{StatusCode: 202, ReasonPhrase: 'Accepted', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
  {
    ETag: &quot;0x8D8C2D61A12C96B&quot;
    Server: Windows-Azure-File/1.0
    Server: Microsoft-HTTPAPI/2.0
    x-ms-request-id: [some guid]
    x-ms-version: 2017-04-17
    x-ms-copy-id: [some guid]
    x-ms-copy-status: success
    Date: Wed, 27 Jan 2021 15:13:28 GMT
    Content-Length: 0
    Last-Modified: Wed, 27 Jan 2021 15:13:28 GMT
  }}
  </code></pre>
  <p>same requests for the following files work:</p>
  <ul>
  <li>11866.jpg 207.77 KiB</li>
  <li>pancakes.jpg 6.26 MiB</li>
  <li>subcontractor.pdf 232.36 KiB</li>
  <li>text.txt 908 B</li>
  </ul>
  <p><em><strong>Test 02</strong></em>: copy 2M.jpg from source to destination</p>
  <p>Request:</p>
  <pre><code>{Method: PUT, RequestUri: 'https://[myaccount].file.core.windows.net/[myshare]/destination/2M.jpg', Version: 1.1, Content: &lt;null&gt;, Headers:
  {
    x-ms-date: Wed, 27 Jan 2021 15:16:51 GMT
    x-ms-version: 2017-04-17
    x-ms-copy-source: https://[myaccount].file.core.windows.net/[myshare]/source/2M.jpg
    Authorization: SharedKey [myaccount]:QWYuXaE0Djs8k3xtOYMpZ831zX/mVD1Kwx1jgwDK9Oo=
    Request-Id: [value is same as successful requests]
  }}
  </code></pre>
  <p>Response:</p>
  <pre><code>{StatusCode: 403, ReasonPhrase: 'Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
  {
    Server: Microsoft-HTTPAPI/2.0
    x-ms-request-id: [some guid]
    Date: Wed, 27 Jan 2021 15:16:51 GMT
    Content-Length: 763
    Content-Type: application/xml
  }}
  </code></pre>
  <p>same requests for the following files fail with the same status and reason:</p>
  <ul>
  <li>15M.jpg 15.13 MiB</li>
  <li>2M.jpg 2.77 MiB</li>
  <li>7M.jpg 7.77 MiB</li>
  <li>FCVideo.jpg 106.09 MiB</li>
  <li>FCVideo.mp4 106.09 MiB</li>
  <li>FluentConference.zip 1020.49 MiB</li>
  </ul>
  <p>All jpg files in the above list are actually either .exe or .zip files that have been renamed.</p>