Created
December 18, 2018 07:00
-
-
Save andy51002000/d939f55a19e760baab0a457e70d0f2e4 to your computer and use it in GitHub Desktop.
Create Container on Azure Blob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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