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.