当我在门户中手动创建blob并尝试以下操作时:
const blockBlobClient = containerClient.getAppendBlobClient('appendtest.csv');
const uploadBlobResponse = await blockBlobClient.appendBlock('test,','test,'.length);
像魅力一样工作。
但是如果我尝试:
const blockBlobClient = containerClient.uploadBlockBlob('appendtest2.csv','test,','test,'.length, {"x-ms-blob-type":"AppendBlob"});
const uploadBlobResponse = await blockBlobClient.appendBlock('test,','test,'.length);
我收到错误消息,表明blob不是受支持的类型。
答案 0 :(得分:0)
在仔细研究了Type定义后,解决了这个问题:
const blockBlobClient = await containerClient.getAppendBlobClient('appendtest5.csv');
const createresponse = await blockBlobClient.create();
const uploadBlobResponse = await blockBlobClient.appendBlock('test,','test,'.length);