0
votes

I am trying to query Azure Table which has column property such as Azure Resource Name, Blackoutperiodstartdate, Blackoutperiodenddate having Partition Key set to resourceId of the respective Azure Resource Name, however I am getting the following error:

azure.TableQuery.CombineFilters is not a constructor

while executing the below code using Azure Functions(HttptriggerJavascript)

var pkFilter = new azure.TableQuery().where('PartitionKey eq ?', 'coewebapptestid');
var resourceFilter = new azure.TableQuery().where('resourcename eq ?', 'coewebapptest');
var combinedFilter = new azure.TableQuery.CombineFilters(pkFilter, TableOperators.And, resourceFilter);

var tablequery = new azure.TableQuery().where(combinedFilter);

tableService.queryEntities('blackoutperiodtable', tablequery, null, function(error, result){
    if(!error){
        // Entity available in serverEntity variable

    }

I am looking out to use multiple 'where' or 'combine filter' to basically query the Partition key and then find the associated resource name property value along with start date & end date values from the Azure Table as an output of my table query.

1

1 Answers

0
votes

If you look at the documentation for combineFilters, you will notice that it is a static method thus you can't really create an instance of this.

Try something like this:

var combinedFilter = azure.TableQuery.CombineFilters(pkFilter, TableOperators.And, resourceFilter);