0

I set up a storage account (Blob, v2) with two containers. I uploaded a test excel file into one of the containers. Now I would like to use Azure Cloudshell PowerShell in order to copy that file from one of the containers and insert it to the other.

Does anyone know what command(s) I've got to type in there? (command, src-format, dest-format)

Thanks in advance

PS: cp https://...blob... https://...blob... returns "cannot stat 'https://...blob...': no such file or directory"

T1B
  • 21
  • 1
  • 4
  • 3
    Do you need to use PowerShell? Because if not, azcopy might be an easy solution for you with well-documented examples (and it is available in Cloudshell too): https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-copy – holger Aug 02 '22 at 05:55
  • 1
    @holger Many thanks for the advice and the link. It worked. I used azcopy in cloudshell and was able to copy the files from one container to the other :) To others: Also, the following link is noteworthy in the above context https://stackoverflow.com/questions/60602497/azcopy-error-this-request-is-not-authorized-to-perform-this-operation – T1B Aug 02 '22 at 08:29

1 Answers1

0

Glad that @ T1B for solved the issue. Thank you @holger for the workaround that helped to fix the issue. Posting this on behalf of your discussion and few points so that it will be beneficial for other community members.

To copy the files between containers we can use the below cmdlts after azcopy login. So that we can able to copy the files within container as mentioned in this MICROSOFT DOCUMENT .

azcopy copy 'https://staccount.blob.core.windows.net/test1/Stack Overflow.xlsx' 'https://destStaccount.blob.core.windows.net/test2/Stack Overflow.xlsx' --recursive

To do the above make sure that we have sufficient permissions to that storage account likewise storage blob data contributor or owner role.

For more information please refer this similar SO THREAD| How to copy files from one container to another containers fits equally in all dest containers according to size using powershell

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15