Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Azure SDK Method using this module #151

Open
tkskumar opened this issue Feb 10, 2021 · 0 comments
Open

Accessing Azure SDK Method using this module #151

tkskumar opened this issue Feb 10, 2021 · 0 comments

Comments

@tkskumar
Copy link

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant