Skip to content

Instantly share code, notes, and snippets.

@andy51002000
Created December 18, 2018 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andy51002000/d939f55a19e760baab0a457e70d0f2e4 to your computer and use it in GitHub Desktop.
Save andy51002000/d939f55a19e760baab0a457e70d0f2e4 to your computer and use it in GitHub Desktop.
Create Container on Azure Blob
var azure = require('azure-storage');
var blobService = azure.createBlobService("andytestapp",
"5gs4i123123adasd23423423412312323423424234234234234Mg==");
module.exports = {
createContainerIfNotExists(containerName) {
return new Promise(function(resolve, reject) {
blobService.createContainerIfNotExists(containerName, {
publicAccessLevel: 'blob'
}, function(error, result, response) {
if (!error) {
resolve(result);
return;
}
reject(err);
});
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment