Azure CLI下载错误

时间:2016-04-27 16:31:19

标签: azure azure-storage-blobs

除了< azure storage blob download'之外,我能够运行示例代码。言。

无论我做什么,我都会收到以下错误消息:

错误:ENOENT,打开我的本地目标文件'

的路径

知道问题可能是什么?

#!/bin/bash
# A simple Azure storage example

export AZURE_STORAGE_ACCOUNT='my account'
export AZURE_STORAGE_ACCESS_KEY='my key'

export container_name='test4'
export blob_name='test.json'
export image_to_upload='/pathto my local file to uppload/test.json'
export destination_folder=~/path to my local folder for download/

echo "Creating the container..."
azure storage container create $container_name

echo "Uploading the image..."
azure storage blob upload $image_to_upload $container_name $blob_name

echo "Listing the blobs..."
azure storage blob list $container_name

echo "Downloading the image..."
azure storage blob download $container_name $blob_name $destination_folder

echo "Done"

1 个答案:

答案 0 :(得分:1)

当我将 destination_folder 更改为明确的文件路径时,它可以正常工作。

export destination_folder="/home/steven/Downloads/result.json"

将其命名为 destination_file 而不是 destination_folder 应该更合适。