首页 > 解决方案 > Azure 存储 blob - ConditionNotMet

问题描述

我试图从 azure storage (az cli) 下载 blob,但我有这个。有人可以知道如何解决吗?

ErrorCode: ConditionNotMet
<?xml version="1.0" encoding="utf-8"?><Error><Code>ConditionNotMet</Code><Message>The condition specified using HTTP conditional header(s) is not met.
RequestId:8nnpca91-201e-011p-7n9e-b1a77b000900
Time:2020-11-23T11:48:11.4500961Z</Message></Error>

标签: azureazure-blob-storageazure-cli

解决方案


在不知道您尝试运行的确切命令的情况下,我无法重现您的问题,但这里是az storage blob download命令的基本语法以及一个有效的示例:

az storage blob download --container-name <storage-account-container-name> --file <file-path-to-write-out-to> --name <blob-name> --account-name <storage-account-name> --account-key <storage-account-access-key>

例子:

$ az storage blob download --container-name testbkp --file backup1.log --name backup1.log --account-name myStorageAccount --account-key r+nHfm5ZZxf9r4TueZ7bmkVFwO8cBi+wmq/9g==

Finished[#############################################################]  100.0000%
{
  "content": null,
  "deleted": false,
  "metadata": {},
  "name": "backup1.log",
  "properties": {
    "appendBlobCommittedBlockCount": null,
    "blobTier": null,
    "blobTierChangeTime": null,
    "blobTierInferred": false,
    "blobType": "BlockBlob",
    "contentLength": 503,
    "contentRange": "bytes 0-502/503",
    "contentSettings": {
      "cacheControl": null,
      "contentDisposition": null,
      "contentEncoding": null,
      "contentLanguage": null,
      "contentMd5": "b8Lzmr+LfkdoZaPujOqVlg==",
      "contentType": "application/octet-stream"
    },
    "copy": {
      "completionTime": null,
      "id": null,
      "progress": null,
      "source": null,
      "status": null,
      "statusDescription": null
    },
    "creationTime": "2020-10-11T16:23:35+00:00",
    "deletedTime": null,
    "etag": "\"0x8D86E0100F405DC\"",
    "lastModified": "2020-10-11T16:23:35+00:00",
    "lease": {
      "duration": null,
      "state": "available",
      "status": "unlocked"
    },
    "pageBlobSequenceNumber": null,
    "remainingRetentionDays": null,
    "serverEncrypted": true
  },
  "snapshot": null
}

请注意,您传递给帐户的参数名称区分大小写。如果您使用最新版本的 Azure CLI(截至今天为2.15.1 )仍然遇到问题,您也可以从Azure Cloud Shell尝试一下。


推荐阅读