gpt4 book ai didi

javascript - 如何从 node.js 创建 Azure AppendBlob

转载 作者:太空宇宙 更新时间:2023-11-04 01:52:06 24 4
gpt4 key购买 nike

我已经安装了 npm azure-storage 软件包。

在 Azure 上,我创建了一个存储帐户和一个容器。

然后我尝试创建一个追加 Blob:

const azure = require('azure-storage');
const service = azure.createBlobService("[ACCOUNT]", "[KEY]");
service.createAppendBlobFromText("[CONTAINER]",
"some-blob-name",
"some-text",
{},
(err, result) => {
console.log('err ->',err);
console.log('result ->',result);
});

调用的结果是:

err -> { Error
at Function.StorageServiceClient._normalizeError (/[REMOVED]/node_modules/azure-storage/lib/common/services/storageserviceclient.js:1191:23)
at BlobService.StorageServiceClient._processResponse (/[REMOVED]/node_modules/azure-storage/lib/common/services/storageserviceclient.js:738:50)
at Request.processResponseCallback [as _callback] (/[REMOVED]/node_modules/azure-storage/lib/common/services/storageserviceclient.js:311:37)
at Request.self.callback (/[REMOVED]/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/[REMOVED]/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/[REMOVED]/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1045:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
name: 'StorageError',
message: 'Append blobs are not supported.\nRequestId:ed1777f4-601c-00cf-19a0-bb77ba000000\nTime:2018-03-14T14:25:50.8138962Z',
code: 'BlobTypeNotSupported',
statusCode: 400,
requestId: 'ed1777f4-601c-00cf-19a0-bb77ba000000' }
result -> null

在搜索错误时我找不到任何东西。

我在这里遗漏了什么吗?

最佳答案

请检查您尝试在其中创建此 blob 的存储帐户的冗余类型。

Blob 类型支持因存储帐户冗余类型而异。

例如,ZRS Classic 冗余类型的存储帐户仅支持 Block Blob,而 Premium LRS 冗余类型的存储帐户仅支持 >页面 block

关于javascript - 如何从 node.js 创建 Azure AppendBlob,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49280625/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com