英文:
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存储有五个文件,如下所示:
命令:
您可以使用以下命令将多个文件复制到您的home目录。
azcopy cp "https://venkat123.blob.core.windows.net/test1/?
输出:
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
最终作业状态:已完成
执行上述命令后,您可以在您的home目录中看到文件,如下所示:
参考:
英文:
> 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:
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
Once you execute the above command, you can see the files in your home directory like below:
Reference:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论