AzCopy 将本地文件作为文件而不是 Blob 上传到 Azure 存储
AzCopy uploading local files to Azure Storage as files, not Blobs
我正在尝试使用以下命令 (AzCopy 5.1.1) 从我的本地硬盘将 550K 文件上传到 Azure Blob 存储 -
AzCopy /Source:d:\processed /Dest:https://ContainerX.file.core.windows.net/fec-data/Reports/ /DestKey:SomethingSomething== /S
它立即开始搅拌。
但它实际上是在创建一个名为 fec-data/reports 的新 Azure File Storage 文件夹,而不是在 Azure Blob 中创建新的 blob文件夹 fec-data/reports 我已经创建了。
我错过了什么?
此外,是否可以保留旧文件的创建日期(或类似)值?
谢谢,
我认为您必须获取要部署文件的 bob 实例
喜欢 :
AzCopy /Source:d:\processed /Dest:https://ContainerX.blob.core.windows.net/fec-data/Reports/ /DestKey:SomethingSomething== /S
Blob:上传
上传单个文件
AzCopy /Source:C:\myfolder/Dest:https://myaccount.blob.core.windows.net/mycontainer /DestKey:key /Pattern:"abc.txt"
如果指定的目标容器不存在,AzCopy 将创建它并将文件上传到其中。
上传单个文件到虚拟目录
AzCopy /Source:C:\myfolder /Dest:https://myaccount.blob.core.windows.net/mycontainer/vd /DestKey:key /Pattern:abc.txt
如果指定的虚拟目录不存在,AzCopy 将上传文件以在其名称中包含虚拟目录(例如,上例中的 vd/abc.txt)。
请参考 link :https://docs.microsoft.com/en-us/azure/storage/storage-use-azcopy
But it's actually creating a new Azure File Storage folder called
fec-data/reports rather than creating new blobs in the Azure Blob
folder fec-data/reports I've already created.
What am I missing?
您看到此行为的原因是您上传到 File
存储而不是 Blob
存储。要将文件上传到 Blob
存储,您需要指定 blob 服务端点 (blob.core.windows.net
)。所以你的命令是:
AzCopy /Source:d:\processed /Dest:https://ContainerX.blob.core.windows.net/fec-data/Reports/ /DestKey:SomethingSomething== /S
Also, is there anyway to keep the date created (or similar) values of
the old files?
假设您想让 blob 的创建日期与桌面文件的创建日期保持一致,那么这是不可能的。 Blob 的 Last Modified Date/Time
是一个系统 属性,它在创建 blob 时分配,并在每次更改 blob 时更新。但是,您可以使用 blob 的元数据并将文件的创建 date/time 存储在那里。
我正在尝试使用以下命令 (AzCopy 5.1.1) 从我的本地硬盘将 550K 文件上传到 Azure Blob 存储 -
AzCopy /Source:d:\processed /Dest:https://ContainerX.file.core.windows.net/fec-data/Reports/ /DestKey:SomethingSomething== /S
它立即开始搅拌。
但它实际上是在创建一个名为 fec-data/reports 的新 Azure File Storage 文件夹,而不是在 Azure Blob 中创建新的 blob文件夹 fec-data/reports 我已经创建了。
我错过了什么?
此外,是否可以保留旧文件的创建日期(或类似)值?
谢谢,
我认为您必须获取要部署文件的 bob 实例 喜欢 :
AzCopy /Source:d:\processed /Dest:https://ContainerX.blob.core.windows.net/fec-data/Reports/ /DestKey:SomethingSomething== /S
Blob:上传 上传单个文件
AzCopy /Source:C:\myfolder/Dest:https://myaccount.blob.core.windows.net/mycontainer /DestKey:key /Pattern:"abc.txt"
如果指定的目标容器不存在,AzCopy 将创建它并将文件上传到其中。
上传单个文件到虚拟目录
AzCopy /Source:C:\myfolder /Dest:https://myaccount.blob.core.windows.net/mycontainer/vd /DestKey:key /Pattern:abc.txt
如果指定的虚拟目录不存在,AzCopy 将上传文件以在其名称中包含虚拟目录(例如,上例中的 vd/abc.txt)。
请参考 link :https://docs.microsoft.com/en-us/azure/storage/storage-use-azcopy
But it's actually creating a new Azure File Storage folder called fec-data/reports rather than creating new blobs in the Azure Blob folder fec-data/reports I've already created.
What am I missing?
您看到此行为的原因是您上传到 File
存储而不是 Blob
存储。要将文件上传到 Blob
存储,您需要指定 blob 服务端点 (blob.core.windows.net
)。所以你的命令是:
AzCopy /Source:d:\processed /Dest:https://ContainerX.blob.core.windows.net/fec-data/Reports/ /DestKey:SomethingSomething== /S
Also, is there anyway to keep the date created (or similar) values of the old files?
假设您想让 blob 的创建日期与桌面文件的创建日期保持一致,那么这是不可能的。 Blob 的 Last Modified Date/Time
是一个系统 属性,它在创建 blob 时分配,并在每次更改 blob 时更新。但是,您可以使用 blob 的元数据并将文件的创建 date/time 存储在那里。