azure azcopy sync在源扫描0个文件

fzsnzjdm  于 2023-03-31  发布在  其他
关注(0)|答案(1)|浏览(161)

我正在尝试在Linux计算机上使用azcopy CLI同步两个Azure Blob存储容器。使用的服务主体具有“存储Blob数据贡献者”角色。此外,源容器https://sourcestoragetest103.blob.core.windows.net/testcontainer中有一个包含csv文件的目录。
目标容器https://destinationstoragetest103.blob.core.windows.net/testcontainer为空。
使用的bash脚本看起来像这样:

azcopy login --tenant-id $AZCOPY_TENANT_ID --service-principal --application-id $AZCOPY_SPA_APPLICATION_ID

azcopy sync https://sourcestoragetest103.blob.core.windows.net/testcontainer https://destinationstoragetest103.blob.core.windows.net/testcontainer --recursive=true --delete-destination=true --check-md5

运行输出:

INFO: If you set an environment variable by using the command line, that variable will be readable in your command line history. Consider clearing variables that contain credentials from your command line history.  To keep variables from appearing in your history, you can use a script to prompt the user for their credentials, and to set the environment variable.
INFO: SPN Auth via secret succeeded.
INFO: SPN Auth via secret succeeded.
INFO: Authenticating to destination using Azure AD
INFO: Authenticating to source using Azure AD
INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support

Job 59fac848-bde6-864a-4c9c-c96ad46711c9 has started
Log file is located at: /home/userme/.azcopy/59fac848-bde6-864a-4c9c-c96ad46711c9.log

100.0 %, 0 Done, 0 Failed, 0 Pending, 0 Total, 2-sec Throughput (Mb/s): 0

Job 59fac848-bde6-864a-4c9c-c96ad46711c9 Summary
Files Scanned at Source: 0
Files Scanned at Destination: 0
Elapsed Time (Minutes): 0.0334
Number of Copy Transfers for Files: 0
Number of Copy Transfers for Folder Properties: 0 
Total Number Of Copy Transfers: 0
Number of Copy Transfers Completed: 0
Number of Copy Transfers Failed: 0
Number of Deletions at Destination: 0
Total Number of Bytes Transferred: 0
Total Number of Bytes Enumerated: 0
Final Job Status: Completed

azcopy二进制文件在源目录中找不到目录和文件。

zpf6vheq

zpf6vheq1#

我尝试在我的环境中重现相同的结果,如下所示

Files Scanned at Source:  0  
Files Scanned at Destination:  0  
Number of Copy Transfers for Files:  0

注意:根据您的错误,azcopy sync命令无法找到任何要从源容器同步到目标容器的文件。
要验证源容器中是否存在文件,可以运行以下命令:

sudo azcopy list https://storageaccount.blob.core.windows.net/kamalifile

输出:

我已经按照以下步骤将文件从一个容器复制到Linux VM中的另一个容器。
1.已创建应用程序并为存储帐户分配了角色。
1.一旦创建应用程序登录与服务principle使用下面的命令。

sudo azcopy login --tenant-id $AZCOPY_TENANT_ID --service-principal --application-id $AZCOPY_SPA_APPLICATION_ID 

sudo azcopy sync "https://storageaccountname.blob.core.windows.net/kamalifile<sastoken>" "https://storageaccountname.blob.core.windows.net/myfile<sastoken>" --recursive=true --delete-destination=true

输出:

运行上述命令后,文件将复制到门户中的另一个容器。

相关问题