nestjs / azure-storage

Azure Storage module for Nest framework (node.js) ☁️

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Accessing Azure SDK Method using this module

tkskumar opened this issue · comments

It can be a change request or on top of this if we can access azure blobService so we can access all different methods on azure blob provided by azure SDK

I'm submitting a...


[ ] Regression 
[ ] Bug report
[*] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

  • works fine when you just need to upload only

Expected behavior

I am just checking if we can access blobService in injectable service and do all rest operation on azure blob SDK
like shown in below examples

const storage = require("azure-storage");

const blobService = storage.createBlobService();

const listContainers = async () => {
  return new Promise((resolve, reject) => {
    blobService.listContainersSegmented(null, (err, data) => {
      if (err) {
        reject(err);
      } else {
        resolve({
          message: `${data.entries.length} containers`,
          containers: data.entries,
        });
      }
    });
  });
};

const createContainer = async (containerName) => {
  return new Promise((resolve, reject) => {
    blobService.createContainerIfNotExists(
      containerName,
      { publicAccessLevel: "blob" },
      (err) => {
        if (err) {
          reject(err);
        } else {
          resolve({ message: `Container '${containerName}' created` });
        }
      }
    );
  });
};

I am just wondering if i can do more then just simple file upload from this module

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Nest version: X.Y.Z

 
For Tooling issues:
- Node version: XX  
- Platform:  

Others: