azure - 有什么方法可以将一组文件批量上传到 ADLS gen2 存储吗?

标签 azure azure-pipelines azure-blob-storage azure-data-lake-gen2

我想用 Azure 中的 ADLS Gen 2 功能替换我的 Blob 存储。要点是,我使用以下命令将构建管道中的一批文件上传到 Blob 中的某个容器:

az storage blob upload-batch \
          --destination "storage-container-files" \
          --account-name "accountname" \
          --source "./files"

这工作得很好。现在我想做同样的事情,但是对于 Gen2 datalake,我必须使用 az storage blob .... 命令。但是我找不到类似于“upload-batch”的东西,只有单个文件上传命令。我希望不必在 yaml 或 Python 脚本中循环。

是否有任何简单的方法可以像使用 blob 那样批量上传?

最佳答案

当然有:

trigger:
- none

pool:
  vmImage: ubuntu-latest

steps:
- task: AzureCLI@2
  inputs:
    azureSubscription: 'testbowman_in_AAD'
    scriptType: 'bash'
    scriptLocation: 'inlineScript'
    inlineScript: |
      az storage fs directory upload -f xxx/dir --account-name bowmantest -s "files" --recursive --connection-string "xxx"

这是我的 repo 结构:

enter image description here

并成功:

enter image description here

引用这个:

https://learn.microsoft.com/en-us/cli/azure/storage/fs/directory?view=azure-cli-latest#az-storage-fs-directory-upload

Upload files or subdirectories to a directory in ADLS Gen2 file system.

关于azure - 有什么方法可以将一组文件批量上传到 ADLS gen2 存储吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73621746/

相关文章:

azure - Windows Azure 云存储 - 根目录中大量文件的影响

azure - 降低数据工厂成本

build-process - Build 2015,vNext,仅当自上次构建以来源发生变化时,才每晚触发计划构建

azure - 在摘要页面上显示 Azure Devops Pipeline 测试成功百分比

node.js - Azure DevOps 扩展中的 Node Cipheriv 警告 - 发布任务

c# - 云 block Blob : DownloadTextAsync and UploadTextAsync and Metadata/Properties

azure - 尽管值为 true,但阶段条件未评估为 true

azure - 使用 AZCopy (v10) 的同步功能是否算作每个 Blob 对目标的 Blob 访问?

azure - 通过 Azure 逻辑应用从 Azure 容器中上次修改的文件夹中获取 Blob 内容

azure - 如何从 Azure 命令 "results"的 'az group list in powershell' 数组中只选择一个属性?