title: Azure REST API PUT Header in Node.js for Copying Blob
body: <p>Running the below GET request node.js works:</p>
  <pre><code>const CryptoJS = require(&quot;crypto-js&quot;);
  const account = 'account'
  const containerName = 'container'
  const blobName = 'picture.jpeg'
  const blobUrl = `https://${account}.blob.core.windows.net/${containerName}/${blobName}`
  
  const key = 'accesskey'
  const strTime = (new Date()).toUTCString();
  const strToSign = `GET\n\n\n\n\n\n\n\n\n\n\n\nx-ms-date:${strTime}\nx-ms-version:2020-10-02\n/${account}/\ncomp:list`;
  
  const secret = CryptoJS.enc.Base64.parse(key);
  const hash = CryptoJS.HmacSHA256(strToSign, secret);
  const hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
  const auth = `SharedKey ${account}:`+hashInBase64; 
  
  let getConfig = {
      headers: {
          'Authorization': auth,
          'x-ms-date': strTime,
          'x-ms-version': &quot;2020-10-02&quot;,
      }
  }
  
     
  export default async (req, res) =&gt; {
      if (req.method === 'POST') {
  
          fetch(`https://${account}.blob.core.windows.net/?comp=list`, getConfig)
          .then( results =&gt; {
              if(results.status==200) {console.log('api works')} else {console.log(results)}},
              res.end()
          )
      } 
  }
  </code></pre>
  <p>I then want to copy a blob with access tier &quot;Archive&quot;. Running the same code with the below changes for a PUT request doesn't work:</p>
  <p>const blobUrl = <code>https://${account}.blob.core.windows.net/${containerName}/${blobName}</code></p>
  <p>const strToSign = <code>PUT\n\n\n\n\n\n\n\n\n\n\n\nx-ms-date:${strTime}\nx-ms-version:2020-10-02\n/${account}/\n${containerName}/\n${blobName}</code>;</p>
  <pre><code>const putConfig = {
      method: 'PUT', 
      headers: {
          'Authorization': auth,
          'x-ms-date': strTime,
          'x-ms-version': &quot;2020-10-02&quot;,
          'x-ms-copy-source': blobUrl,
          'x-ms-requires-sync':'true',
      }
  }
      
  </code></pre>
  <p>fetch(<code>https://${account}.blob.core.windows.net/${containerName}/${blobName}</code>, putConfig)</p>
  <p>Can anyone tell me what I need to change to run the PUT request successfully?</p>