我的目录中有超过一百万个文件。我可以使用此命令有选择地下载文件,而不会出现任何问题:
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]
关于我可以尝试的任何想法。
答案 0 :(得分:2)
对于--include-pattern
,您应该使用双引号包含该值,例如“ 1000 *” ,而不是'1000 *'。
还要使用azcopy的最新版本10.3.2,请按照this link下载。
这是我遵循的步骤,效果很好:
1。在azure门户中->中止到您的存储帐户->在左窗格中,单击“共享访问签名”,然后生成一个sas令牌(您应该复制sas令牌,该令牌可在步骤2中使用) 。截图如下:
2。然后构建您的源URL,例如https://yy3.blob.core.windows.net/t11/folder1/folder2?sas-Token。
3。如下所示的完整命令,请注意将--include-pattern
的值用双引号:
azcopy.exe copy "https://yy3.blob.core.windows.net/test1/folder1/folder2?sas-token" C:\temp\YYYY --recursive --include-pattern "1000*"
4。测试结果如下,只有匹配的文件是副本: