gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 06:51:21 30 4
gpt4 key购买 nike

我想用 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 filesystem.

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

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com