I'm writing a Azure function app to query entities, I'm getting the response in the callback but when result body is set with response it still returns empty,
I am not able to return the entities as response because the process thread finishes before the response is set ,I'm not sure how to solve this I've tried setInterval but no luck
below is the code
module.exports = async function (context, req) {
var storage = require('azure-storage')
var storageClient = storage.createTableService(process.env.connectionString)
var storageTableQuery = storage.TableQuery
var query = new storageTableQuery().top(1).where('Mobile eq \'' + context.req.query.mobile + '\'')
storageClient.queryEntities("Customers", query, null, function (error, result) {
if (error) {
context.res = {
status: 200,
body: error
}
}
else {
context.res = {
status: 200,
body: result.entries,
headers: {
'Content-Type': 'application/json'
}
}
}
});
}


continuationTokeninresult?continuationTokenis null