In this post, we are going to copy a file from one container to another container in the same storage account.
- We create the storage account
- In storage account 1 we have already created two containers and upload a file to container 1
- We change the shared access signature for this storage account
- at the end we click on the button "Generate the connection string and SAS"
- We copy the following URL
- We must install AzCopy with the following command
#Download AzCopy Invoke-WebRequest -Uri "https://aka.ms/downloadazcopy-v10-windows" -OutFile AzCopy.zip -UseBasicParsing #Curl.exe option (Windows 10 Spring 2018 Update (or later)) curl.exe -L -o AzCopy.zip https://aka.ms/downloadazcopy-v10-windows #Expand Archive Expand-Archive ./AzCopy.zip ./AzCopy -Force #Move AzCopy to the destination you want to store it Get-ChildItem ./AzCopy/*/azcopy.exe | Move-Item -Destination "C:\Users\jesus\AzCopy\AzCopy.exe" #Add your AzCopy path to the Windows environment PATH (C:\Users\jesus\AzCopy in this example), e.g., using PowerShell: $userenv = [System.Environment]::GetEnvironmentVariable("Path", "User") [System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Users\jesus\AzCopy", "User")
- this is the output of the command
- We validate the installation
- To start the copy of the file from container1 to container2, we execute the following command
origin: is the URL of point5, we add "/container1/*" after the first part of the URL
destination: it's the same URL only we changed the URL of the container
- We see the result of AzCopy
- We validate that the file has been copied to the other container