gpt4 book ai didi

azure - BlobServiceClient 对象没有属性 `exists`

转载 作者:行者123 更新时间:2023-12-02 23:35:52 28 4
gpt4 key购买 nike

我创建了一个 azure 管道。添加了从 blobStorage 下载文件的任务。

但我收到以下错误:

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'BlobServiceClient' object has no attribute 'exists'Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 658, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 721, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 713, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/init.py", line 385, in new_handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/init.py", line 385, in new_handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/_exception_handler.py", line 17, in file_related_exception_handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 692, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 328, in call
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/operations/blob.py", line 363, in storage_blob_download_batch
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/util.py", line 16, in collect_blobs
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/util.py", line 16, in
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/util.py", line 31, in collect_blob_objects
AttributeError: 'BlobServiceClient' object has no attribute 'exists'To open an issue, please run: 'az feedback'
##[error]PowerShell exited with code '1'.\

任务中编写的内联脚本:

az storage blob download-batch --destination $(build.sourcesDirectory) --pattern $(jmxfile) -s $(jmeter-storagecontainer) --account-name $(az-storageaccount) --account-key '$(az-accountkey)' --connection-string '$(az-connstring)'

我已验证所有变量值均正确且 jmxfile 模式也正确。

知道为什么会出现此 BlobServiceClient Object has no attribute 'exists' 错误吗?

最佳答案

如果您使用 az cli 最新版本 并执行,通常会出现错误“BlobServiceClient 对象没有属性‘存在’”>az storage blob download-batch 命令。

  • 要解决该错误,请尝试使用 az storage blob download 作为解决方法。
  • 否则,请尝试通过卸载 Azure cli 最新版本来安装以前的版本
  • 执行上述步骤时,请确保删除最新版本的所有依赖项
  • 请注意--pattern参数仅支持四种情况

enter image description here

  • 请注意,最新 CLI 中存在处理完整 blob 名称的错误。

请查看下面的 GitHub 博客,它证实了上述问题:

Latest az cli fails to run download-batch command · Issue #21966 · Azure/azure-cli · GitHub

关于azure - BlobServiceClient 对象没有属性 `exists`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72040296/

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