azure Getting UncertedHeader Bad Request(400)上传图片时不支持请求中指定的一个头

djp7away  于 2023-10-22  发布在  其他
关注(0)|答案(1)|浏览(129)

这是我的代码。代码中是否有问题?问题究竟出在哪里呢?我错过了什么吗?我使用Azure.Storage.Blobs 12.18.0;

  1. var blobServiceClient = new BlobServiceClient(_connectionString);
  2. var containerClient = blobServiceClient.GetBlobContainerClient(container);
  3. await containerClient.CreateIfNotExistsAsync(PublicAccessType.Blob);

这是详细信息。

  1. One of the headers specified in the request is not supported.
  2. RequestId:80012b75-701c-0040-5aaa-ffd8bc000000
  3. Time:2023-10-15T20:57:42.9066248Z
  4. Status: 400 (One of the headers specified in the request is not supported.)
  5. ErrorCode: UnsupportedHeader
  6. Additional Information:
  7. HeaderName: x-ms-blob-public-access
  8. Content:
  9. <?xml version="1.0" encoding="utf-8"?>
  10. <Error><Code>UnsupportedHeader</Code><Message>One of the headers specified in the request is not supported.
  11. RequestId:80012b75-701c-0040-5aaa-ffd8bc000000
  12. Time:2023-10-15T20:57:42.9066248Z</Message><HeaderName>x-ms-blob-public-access</HeaderName></Error>
  13. Headers:
  14. Server: Windows-Azure-Blob/1.0,Microsoft-HTTPAPI/2.0
  15. x-ms-error-code: UnsupportedHeader
  16. x-ms-request-id: 80012b75-701c-0040-5aaa-ffd8bc000000
  17. x-ms-version: 2020-10-02
  18. x-ms-client-request-id: 83edaa76-9947-4a02-a654-1e368c711c4f
  19. Date: Sun, 15 Oct 2023 20:57:42 GMT
  20. Content-Length: 296
  21. Content-Type: application/xml
qybjjes1

qybjjes11#

请检查存储帐户的设置。如果它是一个仅支持Page blob的“Premium”存储帐户,则无法创建具有匿名/blob访问权限的blob容器。此类存储帐户中的blob容器始终是私有的。

相关问题