Azure Function - Table query gets skipped or timeout

Ostage 1 Reputation point
2020-10-16T09:37:17.927+00:00

Hello,

I have a function where I use table storage services, I have no problem in updating data in a azure storage table but I'm unable to use queryEntities.

my code looks like below:

var azure = require('azure-storage');  
var tableService = azure.createTableService(mystuff,mystuff);  
var query = new azure.TableQuery().select(['RowKey']);//or .top(5)  
  
tableService.queryEntities('mytable', query, null, function(error, result, response) {  
  if (!error) {  
    // result.entries contains entities matching the query  
  }  
});  

the table has entries and I need just the RowKey to be pushed in result; there are just 150 entries in the table

if I place a context.log to check till where it get's executed, I have that:

var azure = require('azure-storage');  
var tableService = azure.createTableService(mystuff,mystuff);  
var query = new azure.TableQuery().select(['RowKey']); //or .top(5)  
context.log("control1")  
tableService.queryEntities('mytable', query, null, function(error, result, response) {  
context.log("control2")  
  if (!error) {  
    // result.entries contains entities matching the query  
  }  
});  

control1 appears in console, the control2 is skipped so I guess the tableService.queryEntities is totally skipped.

all the other tableService methods works without issue, any help?

https://learn.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-nodejs#query-a-set-of-entities

I've tried to use promise and await for creating async function but it exceeds 5:00 minutes in live environment, the function crashes.

Any suggestion? On the documentation looks very straight forward and I cannot understand what's wrong with it

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
156 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,210 questions
{count} votes

1 answer

Sort by: Most helpful
  1. sadomovalex 3,626 Reputation points
    2020-10-30T14:10:47.777+00:00

    did you check what happens on the wires via Fiddler or browser dev tools > Network tab when queryEntities method is called? Does response comes back from Azure and which status it has?

    0 comments No comments