Using promises instead of callbacks #1450

activatedgeek opened this Issue Jun 24, 2015 · 5 comments


None yet

3 participants


Is it possible to use promises instead of callbacks?

For instance, consider this code:

var blobStorage = new storage.createBlobService(accountName, accountKey);

blobStorage.createContainerIfNotExists('assets', {
  publicAccessLevel: 'blob'
function(error, result, response) {
  if(error) {
  else if(result) {
    console.log('Container created.');
  else {
    console.log('Container already exists. Moving on..');

With promises such as:

blobStorage.createContainerIfNotExists('assets', {
  publicAccessLevel: 'blob'
.then(function(success){}, function(err){});

How does that help?


reading the method docs "createContainerIfNotExists" and check it out if support promises callbacks instead fn as parameter


@activatedgeek promises are not currently supported - we use the more common callback mechanism.

The calls you are asking about are in the storage data plane library and not just the storage management library, this library may have different promises support, see:

Please file any issues for storage data plane apis in that repo.

@markcowl markcowl closed this Jun 29, 2015


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment