Azure Storage & AzCopy v10 - how to copy a blob to another storage account - ERROR RRS feed

  • Question

  • I'm trying to copy a .VHD file from Azure directly to one of my Azure Storage Accounts.

    And so, I'm performing the following steps:

    1. Download Azcopy v10 .zip folder.

    2. Go to this link - https://docs.microsoft.com/en-gb/azure/storage/common/storage-use-azcopy-blobs#copy-a-blob-to-another-storage-account, and copy the following cmd line:

    azcopy cp "https://<source-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>?<SAS-token>" "https://<destination-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>/<filename>.vhd<SAS-token>"

    3. Go to the VM i want to extract the VHD. Go to the respective Disk and select Disk Export. Copy the URL of the Disk and paste it into the first path available in the cmd line above.

    4. Go to the Storage Account and select the Blob Container where I am going to upload the VHD. Go to its proprieties and copy the URL given. Then paste it into the second path available in the cmd line.

    5. Lastly, I am missing the SAS Token marked in bold, which is the SAS Token referring to the storage account. So, I go back to the storage account and select, on the menu, Shared Access Signature and click on Generate SAS and Connection String. Copy that SAS token into the cmd line.

    6. Run cmd line. 

    I have tested this solution in customer's environments and it works fine, but when I try to test it in my own testing environment I get this error: 

    400 The value for one of the HTTP headers is not in the correct format.. When Setting PageBlob tier

    I'm out of ideas... Does anyone seen this before?

    Thank you

    Tuesday, August 27, 2019 1:31 PM

All replies

  • Hi Bruna.brunobb , Is it possible to check if the copy/paste process did not change the URL, some editors tend to transform specific characters such as ' and " , could you paste the link in to a code editor such as visual studio or atom then onto cmd to try it ? 
    Could you also double check that you're using the latest Azcopy version: https://github.com/Azure/azure-storage-azcopy 
    and also deleting any older version already installed on your test env.
    Tuesday, August 27, 2019 7:05 PM
  • Hi Adam, 

    Thank you for the answer. I'm just using the notepad and then copy pasting the command directly to the cmd line. I don't think the changing of characters is being an issue. :(

    Also, yes I confirm that I'm using the latest AzCopy version.  
    Tuesday, August 27, 2019 8:02 PM
  • Is it possible to regenerate the SAS token through portal to double check that's not the issue ?
    Tuesday, August 27, 2019 8:06 PM
  • I did, I have reviewed the syntax of the cmd many times and even deployed a like-to-like test environment in another Azure subscription to rule out any RBAC configurability problems. Still nothing, the same error remains.

    Tuesday, August 27, 2019 11:05 PM