Azure CLI - Blob 列表命令在与 SAS 令牌一起使用时抛出无效 "InvalidResourceName" 错误

Azure CLI - Blob list command throwing invalid "InvalidResourceName" error while using with SAS token

我在我的机器上使用 AzureCLI 从 Azure 下载和列出 blob。我尝试使用按预期工作的帐户密钥列出 Blob。但当 我尝试使用 SAS 令牌列出它,但出现了下面提到的异常,

** 命令:**

C:\Users222>az storage blob list -c containerName --account-name accountName  -o table --sas-token sp=r&st=2018-10-16T12:53:16Z&se=2018-10-16T20:53:16Z&spr=https&sv=2017-11-09&sig=d%2asdfasdfewerasdf$#$%#$%#$A%3D&sr=b

注意:我从 Azure 门户获得了这个 SAS 令牌

The specified resource does not exist.ErrorCode: ResourceNotFound <?xml version="1.0" encoding="utf-8"?><Error><Code>ResourceNotFound</Code><Message>The specified resource does not exist. RequestId:a108a8f9-d01e-000d-6a6c-6b0194000000 Time:2018-10-24T07:38:04.5834052Z</Message></Error>

如果不将 sas-token 放在引号中,我也会重现该问题。请尝试将 sastoken 字符串括在引号中。

az storage blob list -c containerName --account-name accountName  -o table --sas-token "sp=r&st=2018-10-16T12:53:16Z&se=2018-10-16T20:53:16Z&spr=https&sv=2017-11-09&sig=d%2asdfasdfewerasdf$#$%#$%#$A%3D&sr=b"

测试结果:

注意: 请确保您的 sas 令牌有效。