包含超过一百万个文件的 AzCopy V10 下载目录
AzCopy V10 Download Directory containing over a Million Files
我有一个包含超过一百万个文件的目录。我可以使用此命令有选择地下载文件而不会出现任何问题:
azcopy copy https://XXXXX/YYYY/10000000-0000-0000-0000-000000000000 C:\temp\YYYY
但是,当我尝试根据模式有选择地下载文件时,出现错误。这是我使用的命令:
azcopy copy https://XXXXX/YYYY C:\temp\YYYY --recursive --include-pattern '1000*'
我收到以下错误:
Description=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:XXXXXXXXXXXXXXXXXX
Time:2019-11-20T16:24:57.6698636Z, Details:
AuthenticationErrorDetail: Issuer validation failed. Issuer did not match.
Code: AuthenticationFailed
GET https://XXXXX/YYYY?comp=list&include=metadata&restype=container&timeout=901
Authorization: REDACTED
User-Agent: [AzCopy/10.3.2 Azure-Storage/0.7 (go1.13; Windows_NT)]
X-Ms-Client-Request-Id: [zzzzzzzzzzzzzzzzzz]
X-Ms-Version: [2018-03-28]
--------------------------------------------------------------------------------
RESPONSE Status: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Content-Length: [422]
Content-Type: [application/xml]
Date: [Wed, 20 Nov 2019 16:24:57 GMT]
Server: [Microsoft-HTTPAPI/2.0]
X-Ms-Error-Code: [AuthenticationFailed]
X-Ms-Request-Id: [zzzzzzzzzzzzzzzzz]
关于我可以尝试的任何想法。
对于--include-pattern
,您应该使用双引号来包含值,例如"1000*",而不是'1000*'.
并且也使用最新版本的azcopy 10.3.2,按照this link下载。
以下是我遵循的步骤,效果很好:
1.In azure portal -> nave to your storage account -> 在左窗格中,单击"Shared access signature",然后生成一个sas-token(你应该复制sas token,可以是在步骤 2) 中使用。截图如下:
2.Then 构建您的源代码 url,例如 https://yy3.blob.core.windows.net/t11/folder1/folder2?sas-Token.
3.The 如下所示完成命令,注意使用 双引号 作为 --include-pattern
:
的值
azcopy.exe copy "https://yy3.blob.core.windows.net/test1/folder1/folder2?sas-token" C:\temp\YYYY --recursive --include-pattern "1000*"
4.The测试结果如下,只有匹配到的文件为副本:
我有一个包含超过一百万个文件的目录。我可以使用此命令有选择地下载文件而不会出现任何问题:
azcopy copy https://XXXXX/YYYY/10000000-0000-0000-0000-000000000000 C:\temp\YYYY
但是,当我尝试根据模式有选择地下载文件时,出现错误。这是我使用的命令:
azcopy copy https://XXXXX/YYYY C:\temp\YYYY --recursive --include-pattern '1000*'
我收到以下错误:
Description=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:XXXXXXXXXXXXXXXXXX
Time:2019-11-20T16:24:57.6698636Z, Details:
AuthenticationErrorDetail: Issuer validation failed. Issuer did not match.
Code: AuthenticationFailed
GET https://XXXXX/YYYY?comp=list&include=metadata&restype=container&timeout=901
Authorization: REDACTED
User-Agent: [AzCopy/10.3.2 Azure-Storage/0.7 (go1.13; Windows_NT)]
X-Ms-Client-Request-Id: [zzzzzzzzzzzzzzzzzz]
X-Ms-Version: [2018-03-28]
--------------------------------------------------------------------------------
RESPONSE Status: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Content-Length: [422]
Content-Type: [application/xml]
Date: [Wed, 20 Nov 2019 16:24:57 GMT]
Server: [Microsoft-HTTPAPI/2.0]
X-Ms-Error-Code: [AuthenticationFailed]
X-Ms-Request-Id: [zzzzzzzzzzzzzzzzz]
关于我可以尝试的任何想法。
对于--include-pattern
,您应该使用双引号来包含值,例如"1000*",而不是'1000*'.
并且也使用最新版本的azcopy 10.3.2,按照this link下载。
以下是我遵循的步骤,效果很好:
1.In azure portal -> nave to your storage account -> 在左窗格中,单击"Shared access signature",然后生成一个sas-token(你应该复制sas token,可以是在步骤 2) 中使用。截图如下:
2.Then 构建您的源代码 url,例如 https://yy3.blob.core.windows.net/t11/folder1/folder2?sas-Token.
3.The 如下所示完成命令,注意使用 双引号 作为 --include-pattern
:
azcopy.exe copy "https://yy3.blob.core.windows.net/test1/folder1/folder2?sas-token" C:\temp\YYYY --recursive --include-pattern "1000*"
4.The测试结果如下,只有匹配到的文件为副本: