title: How to use ArangoJS in Azure functions
body: <p>I am trying to access and modify ArangoDB collections from Azure function, the driver is loaded , database is selected but any operation which is async or involves promise seems not to be working .</p>
  
  <pre><code>    Database = require('arangojs').Database;
      db = new Database('http://127.0.0.1:8529');
      if(!db) {
        context.log('failed');
      }
      else {
        context.log('Success');
      }
      db.useDatabase('test1');
      collection = db.collection('test');
  
      if(!collection) {
        context.log('collection failed')
      }
      else {
        context.log('collection success');
      }
      doc = {
          _key: 'ahdbhdb',
          name: 'foo'
      };
  
      collection.save(doc).then(
         meta =&gt; context.log('Document saved:', meta._rev),
         err =&gt; context.error('Failed to save document:', err)
      );
  </code></pre>
  
  <p>Seems like anything inside then isn't being executed. I have tried other functions too.
  Any pointers will be helpful.</p>