jlindsey
jlindsey

Reputation: 53

Node.js azure-storage TableService has no methods

I've been trying to connect to my Azure storage account, but I'm having some problems with the azure-storage module. Specifically, once I create a TableService object, the object only has a filter method on it. Two methods I've tried have been queryTables and createTableIfNotExist. For example, createTableIfNotExistreturns "TypeError: aztd.createTableIfNotExistis not a function". Source code is below.

var azure = require('azure-storage');
var aztd = azure.createTableService();
var azseg = azure.TableUtilities.entityGenerator;
console.log("AZSEG " + Object.getOwnPropertyNames(azseg).filter(function (p) { return typeof azseg[p] === 'function'; }));
console.log("AZTD " + Object.getOwnPropertyNames(aztd).filter(function (p) { return typeof aztd[p] === 'function'; }));
aztd.createTableIfNotExist('table1', function (e, result, res) {
    if (result) console.log('Table created');
});

I'm not getting any additional errors aside from the function not found. The console log returns the functions for both variables:

AZSEG Entity,Int32,Int64,Binary,Boolean,String,Guid,Double,DateTime
AZTD filter

I can see the entityGenerator is created fine, but am I missing anything for the TableService?

Upvotes: 1

Views: 97

Answers (1)

Gary Liu
Gary Liu

Reputation: 13918

Actually, the function name should be createTableIfNotExists, and it seems you have typed an invalid function name.

Also you can refer to source code of azure-storage-node on github to get all functions's info.

Upvotes: 1

Related Questions