AzCopy command

UrBel 240 Reputation points
2025-05-19T04:37:40.5233333+00:00

Hi all,

is there command to getting totally copied blobs on Azure Container and Last blobs/Files copied?

I have 2 million items(files) formatted in *PDF, Word, located on local Drive, I need to know how many successfully files copied on my Azure container...

I use tool AZCopy

thanks for all great respond & reply

thank you

warm regrads,

Urbel

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nandamuri Pranay Teja 3,610 Reputation points Microsoft External Staff Moderator
    2025-05-19T05:21:23.5133333+00:00

    Hello UrBel

    Thank you for your question!

    As You mentioned copying 2 million PDF and Word files from a local drive to an Azure container. If you haven’t already copied the files, use the AZ copy copy command with the --include-pattern option to target only PDF and Word files. Example:

    azcopy copy "C:\local\path" "https://<storage-account-name>.blob.core.windows.net/<container-name>?SAS-token" --include-pattern "*.pdf;*.doc;*.docx" --recursive
    
    • Replace C:\local\path with your local directory path.
    • Replace <storage-account-name> and <container-name> with your Azure Storage account and container names. Append a SAS token or use Microsoft Entra ID for authentication.
    • The --recursive flag ensures subdirectories are included. The --include-pattern ".pdf;.doc;*.docx" filters for PDF and Word files.

    AzCopy logs transfer details, which you can use to verify successful copies. Enable logging with the --log-level flag:

    azcopy copy "C:\local\path" "https://<storage-account-name>.blob.core.windows.net/<container-name>?SAS-token" --include-pattern "*.pdf;*.doc;*.docx" --recursive --log-level INFO
    

    Please be informed that Logs are stored in the directory specified by the AZCOPY_LOG_LOCATION environment variable or in the default location (e.g., %USERPROFILE%.azcopy on Windows).

    Note- AzCopy logs provide detailed information about each file transfer, including success or failure. To check how many files were successfully copied:

    • Locate the AzCopy log files in the default log directory (e.g., %USERPROFILE%.azcopy on Windows) or the directory specified by AZCOPY_LOG_LOCATION.
    • Each log file is named with a timestamp and job ID (e.g., 2025-05-19-1036-1234567890.log).
    • Parse the log to count successful transfers. Look for lines with COMPLETED status.

    References: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-copy

    Hope the above answer helps! Please let us know do you have any further queries.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members. 

    User's image

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.