如何从Azure云shell的blob中将文件添加到$Home目录中

huangapple go评论68阅读模式
英文:

How to add the files in $Home directory from blob of Azure cloud shell

问题

我是新手使用PowerShell,在Azure云Shell中编写代码。
我想要从Blob存储添加文件到Azure云Shell的**$HOME**目录。
我该如何完成这个任务?

非常感谢您的帮助。

要获取用于从Azure Blob存储添加文件到云Shell中的$home目录的脚本

后来
尝试了azcopy命令
但是出现了错误:
在此输入图像描述

我尝试的代码
在此输入图像描述

英文:

I am new to powershell. Writting code in azure cloud shell.
I want to add files in Azure cloud shell $HOME directory from blob storage.
How I can achieve this task?

Really appreciated for help.

To get script to add files into $home directory from azure blob storage in cloud shell

Later
Tried azcopy command
but getting error as:
enter image description here

Code what I tried
enter image description here

答案1

得分: 0

要将文件从Azure Blob存储添加到$home目录的脚本

要将文件从Azure Blob存储复制到$home目录,您可以使用Azcopy工具。

在我的环境中,Azure Blob存储有五个文件,如下所示:

如何从Azure云shell的blob中将文件添加到$Home目录中

命令:

您可以使用以下命令将多个文件复制到您的home目录。

azcopy cp "https://venkat123.blob.core.windows.net/test1/?" "home/" --recursive=true

输出:

INFO: 正在扫描...
INFO: 任何空文件夹将不会被处理,因为源和/或目标不支持完整文件夹。
INFO: azcopy: 可以下载新版本 10.19.0

作业3cd8663a-58a1-xx已启动
日志文件位于:/home/venkatesan/.azcopy/3cd8663a-xxx.log

0.0%,0已完成,0失败,5待处理,0跳过,5总计,

作业3cd8663a-58axxx5931561摘要
经过的时间(分钟):0.0334
文件传输数量:5
文件夹属性传输数量:0
总传输数量:5
已完成的传输数量:5
传输失败的数量:0
传输跳过的数量:0
TotalBytesTransferred:115831
最终作业状态:已完成

如何从Azure云shell的blob中将文件添加到$Home目录中

执行上述命令后,您可以在您的home目录中看到文件,如下所示:

如何从Azure云shell的blob中将文件添加到$Home目录中

参考:

azcopy copy | Microsoft Learn

英文:

> To get the script to add files into the $home directory from Azure blob storage in the cloud shell

To get the files from Azure blob storage to the $home directory, you can use the Azcopy tool.

In my environment, Azure blob storage has five files as like below:

如何从Azure云shell的blob中将文件添加到$Home目录中

Command:

You can use the below command to get the multiple files to your home directory.

 azcopy cp "https://venkat123.blob.core.windows.net/test1/?<Your-sastoken>" "home/" --recursive=true

Output:

INFO: Scanning...
INFO: Any empty folders will not be processed, because the source and/or destination doesn't have full folder support
INFO: azcopy: A newer version 10.19.0 is available to download


Job 3cd8663a-58a1-xx has started
Log file is located at: /home/venkatesan/.azcopy/3cd8663a-xxx.log

0.0 %, 0 Done, 0 Failed, 5 Pending, 0 Skipped, 5 Total, 


Job 3cd8663a-58axxx5931561 summary
Elapsed Time (Minutes): 0.0334
Number of File Transfers: 5
Number of Folder Property Transfers: 0
Total Number of Transfers: 5
Number of Transfers Completed: 5
Number of Transfers Failed: 0
Number of Transfers Skipped: 0
TotalBytesTransferred: 115831
Final Job Status: Completed

如何从Azure云shell的blob中将文件添加到$Home目录中

Once you execute the above command, you can see the files in your home directory like below:

如何从Azure云shell的blob中将文件添加到$Home目录中

Reference:

azcopy copy | Microsoft Learn

huangapple
  • 本文由 发表于 2023年7月18日 03:36:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76707610.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定