简体   繁体   English

从Linux上的Azure Blob存储中上载多个文件

[英]Upload multiple files in Azure Blob Storage from Linux

有没有办法从Linux机器上将多个文件上传到Azure Blob存储,使用终端或应用程序(基于Web还是不基于Web)?

Thank you for your interest – There are two options to upload files in Azure Blobs from Linux: 感谢您的关注 - 从Linux Blob中上传文件有两种方法:

  1. Setup and use XPlatCLI by following the steps below: 按照以下步骤设置和使用XPlatCLI:

    • Install the OS X Installer from http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/ http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/安装OS X安装程序
    • Open a Terminal window and connect to your Azure subscription by either downloading and using a publish settings file or by logging in to Azure using an organizational account (find instructions here) 打开终端窗口并通过下载和使用发布设置文件或使用组织帐户登录Azure来连接到Azure订阅(请在此处查找说明)
    • Create an environment variable AZURE_STORAGE_CONNECTION_STRING and set its value (you will need your account name and account key): “DefaultEndpointsProtocol=https;AccountName=enter_your_account;AccountKey=enter_your_key” 创建一个环境变量AZURE_STORAGE_CONNECTION_STRING并设置其值(您将需要您的帐户名和帐户密钥):“DefaultEndpointsProtocol = https; AccountName = enter_your_account; AccountKey = enter_your_key”
    • Upload a file into Azure blob storage by using the following command: azure storage blob upload [file] [container] [blob] 使用以下命令将文件上载到Azure blob存储:azure storage blob upload [file] [container] [blob]
  2. Use one of the third party web azure storage explorers like CloudPortam: http://www.cloudportam.com/ . 使用CloudPortam等第三方Web azure存储资源管理器之一: http ://www.cloudportam.com/。 You can find the full list of azure storage explorers here: http://blogs.msdn.com/b/windowsazurestorage/archive/2014/03/11/windows-azure-storage-explorers-2014.aspx . 您可以在此处找到azure存储资源管理器的完整列表: http//blogs.msdn.com/b/windowsazurestorage/archive/2014/03/11/windows-azure-storage-explorers-2014.aspx

If you prefer the commandline and have a recent Python interpreter, the Azure Batch and HPC team has released a code sample with some AzCopy-like functionality on Python called blobxfer . 如果您更喜欢命令行并拥有最近的Python解释器,那么Azure Batch和HPC团队已经发布了一个代码示例,其中包含一些名为blobxfer的类似AzCopy的功能 This allows full recursive directory ingress into Azure Storage as well as full container copy back out to local storage. 这允许完全递归目录进入Azure存储以及完整容器复制回本地存储。 [full disclosure: I'm a contributor for this code] [完全披露:我是此代码的撰稿人]

You can use the find command with the exec option to execute the command to upload each file, as described here as described here : 您可以使用find命令和exec选项来执行命令上传的每个文件,这里描述如下描述

find *.csv -exec az storage blob upload --file {} --container-name \
CONTAINER_NAME --name {} --connection-string=‘CONNECTION_STRING’ \;

where CONNECTION_STRING is the connection string of your Azure Blob store container, available from portal.azure.com . 其中CONNECTION_STRING是Azure Blob存储容器的连接字符串,可从portal.azure.com获得 This will upload all CSV files in your directory to the Azure Blob store associated with the connection string. 这会将目录中的所有CSV文件上载到与连接字符串关联的Azure Blob存储。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用位于 azure webapp 中的 .sh 文件将多个文件从本地存储上传到 azure blob 存储 - How to upload multiple files from local storage to the azure blob storage using .sh file that located in azure webapp 如何从 azure 云连接到 linux 服务器并上传到 BLOB 存储? - how to connect to linux server from azure cloud and upload to BLOB storage? 想要将多个文件从Linux服务器复制到Azure blob - want to copy multiple files to Azure blob from Linux server 如何将文件从Azure Blob复制到Linux中的某些路径 - How to copy the files from Azure blob to some of the path in Linux 用于Linux机器上传/下载Azure存储数据的天蓝色命令行工具 - azure command line tool for linux machine to upload/download data to/from Azure Storage 将文件从多个Linux服务器移动到中央Windows存储服务器 - Moving files from multiple Linux servers to a central windows storage server 使用 bash 脚本从 Azure Blob 存储读取 JSON 文件并写回 Blob 存储中的另一个文件 - Read JSON file from Azure Blob Storage using bash script and write back to another file in blob storage 如何使用blobxfer从azure blob存储下载子目录 - how to download a sub directory from azure blob storage using blobxfer 将文件从Linux VPS上传到Web主机 - Upload files from linux vps to web host 使用 AzCopy 将表导出到 Linux 中的 blob 存储 - Using AzCopy for export table to blob storage in Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM