Azure – 尝试获取Blob列表时,服务器无法validation请求

祝您有个好日子,请帮我解答下面的问题?

我试图从zaure cli v1获取特定容器中的blob列表。 以下是我所遵循的步骤:

1) azure login 2) Login via browser 3) from the command line: azure storage blob list \ --container "container_name" -a "storage_account_name" -k $(cat ./storage_account_name.key) 

storage_account_name.key – 具有存储帐户的实际访问密钥。 当我从cli运行该命令时,出现以下错误:

 info: Executing command storage blob list |error: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:<ID of the request> Time:2017-08-18T13:34:53.3484100Z error: Error information has been recorded to /root/.azure/azure.err 

你能告诉我我做错了什么吗? 亚历克斯,先谢谢你

如果要在存储帐户中列出斑点,则首先需要为您的存储帐户和密钥设置两个variables。

 export AZURE_STORAGE_ACCOUNT=<storage_account_name> export AZURE_STORAGE_ACCESS_KEY=<storage_account_key> 

请参阅以下链接:将Azure CLI 1.0与Azure存储配合使用 。

更新:

你的命令适合我。

 root@shui:~# azure storage blob list --container "vhds" -a "shuihvdiag182" -k $(cat ./storage_account_name.key) info: Executing command storage blob list + Getting blobs in container vhds data: Name Blob Type Length Content Type Last Modified Snapshot Time data: ------------------ --------- ------ ------------------------ ----------------------------- ------------- data: Availabilityset.sh BlockBlob 1180 application/octet-stream Tue, 22 Aug 2017 02:13:01 GMT info: storage blob list command OK 

我configurationstorage_account_name.key如下所示:

 aj5tKjaWBCGemBJ+gEmlCFLNP+/1zNgwuPDE+dDkKCXjoRCgdggmwCNDZheMmK8+gRiHUS+qR7NMkWfx5n8tjw== 

我build议你可以检查存储帐户密钥是否过期。 我build议你可以重新生成一个密钥,然后重试。

更新2:

我使用错误访问键时遇到相同的错误日志。 您不需要login您的Azure帐户,使用storage account name + access key可以列出容器中的斑点。 我build议你可以在Portal上检查它们。

在这里输入图像说明