nam
nam

Reputation: 23868

Azure AzCopy command fail to copy csv files to Azure Storage

I am using this Tutorial: Migrate on-premises data to cloud storage with AzCopy from Azure team to copy csv files from my local machine to an Azure Blob Storage. I followed the prerequisites and other requirements but I get the following error whether I copy the entire folder or an individual file.

Question: What could be a cause of the error and how can we resolve it?

Remarks: The folder has 4 files and each file is about 1GB of size.

Error when copying a single file:

PS C:\WINDOWS\system32> azcopy copy "C:\Junk1\MyFileName.csv" "https://myDataLakeStorageName.dfs.core.windows.net/myContainerName" --recursive=true
INFO: Scanning...
INFO: Authenticating to destination using Azure AD
INFO: Any empty folders will be processed, because source and destination both support folders

Job 9eea819a-e3f7-2a4c-4929-d382cc13f5b6 has started
Log file is located at: C:\Users\myusername\.azcopy\9eea819a-e3f7-2a4c-4929-d382cc13f5b6.log

0.0 %, 0 Done, 0 Failed, 1 Pending, 0 Skipped, 1 Total,


Job 9eea819a-e3f7-2a4c-4929-d382cc13f5b6 summary
Elapsed Time (Minutes): 0.0334
Number of File Transfers: 1
Number of Folder Property Transfers: 0
Total Number of Transfers: 1
Number of Transfers Completed: 0
Number of Transfers Failed: 1
Number of Transfers Skipped: 0
TotalBytesTransferred: 0
Final Job Status: Failed

Error when copying the entire folder:

PS C:\WINDOWS\system32> azcopy copy "C:\Junk1\" "https://myDataLakeStorageName.dfs.core.windows.net/myContainerName" --recursive=true
INFO: Scanning...
INFO: Authenticating to destination using Azure AD
INFO: Any empty folders will be processed, because source and destination both support folders

Job 146c0764-b51d-eb40-6077-9fd70591baf0 has started
Log file is located at: C:\Users\myusername\.azcopy\146c0764-b51d-eb40-6077-9fd70591baf0.log

0.0 %, 0 Done, 0 Failed, 5 Pending, 0 Skipped, 5 Total,


Job 146c0764-b51d-eb40-6077-9fd70591baf0 summary
Elapsed Time (Minutes): 0.0335
Number of File Transfers: 4
Number of Folder Property Transfers: 1
Total Number of Transfers: 5
Number of Transfers Completed: 0
Number of Transfers Failed: 5
Number of Transfers Skipped: 0
TotalBytesTransferred: 0
Final Job Status: Failed

PS C:\WINDOWS\system32>

UPDATE

Log file exceeds the size limit of a Stack Overflow post. But, per a request from user @GauravMantri, I'm attaching the link to the log file here: AzCopy_Error_Log. NOTE: This link will expire after 30 days from today November 21, 2021.

Upvotes: 0

Views: 1707

Answers (1)

RamaraoAdapa
RamaraoAdapa

Reputation: 3137

I have tested in my environment.

I tried to copy files from local to storage using azcopy.

I have contributor access to the subscription. I created a data lake gen 2 storage account.

I can upload the blob files to the storage account using Azure portal.

I used AAD authentication to login to AzCopy

Now I used the below command to copy local files to Azure Storage account

azcopy copy "C:\Junk1\MyFileName.csv" "https://myDataLakeStorageName.dfs.core.windows.net/myContainerName/" --recursive=true

But received the below error:

RESPONSE Status: 403 This request is not authorized to perform this operation using this permission.

enter image description here

I used the SAS token to authenticate the storage account and I am able to upload the files to Azure Storage account from my local

I used the below command:

azcopy copy "C:\Junk1\MyFileName.csv" "https://myDataLakeStorageName.dfs.core.windows.net/myContainerName/?sas-token" --recursive=true

enter image description here

Upvotes: 1

Related Questions