User Review
( votes)AzCopy is a command-line utility that can be used for copying data to and from the storage accounts.
Download the appropriate version of the tool –
https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10#download-azcopy
We’d upload the files to the following container
Below will be the source files
Let us login first (here we are using Azure Active Directory to authorize AzCopy, the other option is using SAS token)
It will ask us to open the URL in the browser and enter the code followed by credentials.
After successful sign-in we can close the browser window.
Now let us transfer the directory along with the files inside it using the below syntax
azcopy copy ‘<local-directory-path>’
‘https://<storage-account-name>.<blob or dfs>.core.windows.net/<container-name>’ – -recursive
in our case,
azcopy copy ‘C:\Customers’ ‘https://storageaccountrg9b58.blob.core.windows.net/mycontainer1‘ – -recursive
Get the URL from the Properties of the container
Make sure the account (service principal) used has the Storage Blob Data Contributor or Storage Blog Data Owner role assigned required for uploading the files.
Run the command.
We can see the folder and files successfully transferred.
Check other posts –
Transfer files using – Azure Blob Upload task and Premium File transfer task using SSIS Package
Hope it helps..