这是我的代码。代码中是否有问题?问题究竟出在哪里呢?我错过了什么吗?我使用Azure.Storage.Blobs 12.18.0
;
var blobServiceClient = new BlobServiceClient(_connectionString);
var containerClient = blobServiceClient.GetBlobContainerClient(container);
await containerClient.CreateIfNotExistsAsync(PublicAccessType.Blob);
这是详细信息。
One of the headers specified in the request is not supported.
RequestId:80012b75-701c-0040-5aaa-ffd8bc000000
Time:2023-10-15T20:57:42.9066248Z
Status: 400 (One of the headers specified in the request is not supported.)
ErrorCode: UnsupportedHeader
Additional Information:
HeaderName: x-ms-blob-public-access
Content:
<?xml version="1.0" encoding="utf-8"?>
<Error><Code>UnsupportedHeader</Code><Message>One of the headers specified in the request is not supported.
RequestId:80012b75-701c-0040-5aaa-ffd8bc000000
Time:2023-10-15T20:57:42.9066248Z</Message><HeaderName>x-ms-blob-public-access</HeaderName></Error>
Headers:
Server: Windows-Azure-Blob/1.0,Microsoft-HTTPAPI/2.0
x-ms-error-code: UnsupportedHeader
x-ms-request-id: 80012b75-701c-0040-5aaa-ffd8bc000000
x-ms-version: 2020-10-02
x-ms-client-request-id: 83edaa76-9947-4a02-a654-1e368c711c4f
Date: Sun, 15 Oct 2023 20:57:42 GMT
Content-Length: 296
Content-Type: application/xml
1条答案
按热度按时间qybjjes11#
请检查存储帐户的设置。如果它是一个仅支持Page blob的“Premium”存储帐户,则无法创建具有匿名/blob访问权限的blob容器。此类存储帐户中的blob容器始终是私有的。