小编wtk*_*219的帖子

Azure Blob存储几乎对我的所有PUT请求都给出了“请求中止”

我正在尝试使用Azure Blob存储来存储Blob,但是大部分时间我都会从Blob存储中获得“请求中止”响应。我在Express API中使用Node.js v10 SDK,并且感觉到它与我配置服务的方式有关。

我正在使用Azurite模仿Azure存储服务。

在我的app.js中,我configureBlobStore()在启动时运行函数:

export const configureBlobStore = async containerName => {
  const sharedKeyCredential = new SharedKeyCredential(
    process.env.AZURE_STORAGE_ACCOUNT_NAME,
    process.env.AZURE_STORAGE_ACCOUNT_ACCESS_KEY,
  );
  const pipeline = StorageURL.newPipeline(sharedKeyCredential);
  serviceUrl = new ServiceURL('http://blob:10000/devstoreaccount1', pipeline);

  if (!containerUrl) {
    containerUrl = ContainerURL.fromServiceURL(serviceUrl, containerName);
    try {
      await containerUrl.create(aborter);
    } catch (err) {
      console.log(err);
      console.log('Container already existed, skipping creation');
    }
  }
  return containerUrl;
};
Run Code Online (Sandbox Code Playgroud)

然后保存斑点,我运行我的函数 saveToBlobStore()

  let { originalname: blobName } = file;
  const blockBlobUrl = BlockBlobURL.fromContainerURL(containerUrl, blobName);
  const uploadOptions = { bufferSize: 4 …
Run Code Online (Sandbox Code Playgroud)

azure-storage-blobs

3
推荐指数
1
解决办法
196
查看次数

标签 统计

azure-storage-blobs ×1