I have been trying to return Table Storage rows back in Queue Trigger Function URL, But could not getting success. Below is my code.
public static async Task<List<PatchesList>> Run([QueueTrigger("send-patches-list", Connection =
"AzureWebJobsStorage")]string myQueueItem, [Table(tableName: "getpatcheslist", Connection =
"AzureWebJobsStorage")]CloudTable cloudTable, ILogger log)
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
TableQuery<PatchesList> projectionQuery = new TableQuery<PatchesList>().Select(
new string[] { "RowKey", "Name" });
var grouprows = await cloudTable.ExecuteQuerySegmentedAsync(projectionQuery, null);
List<PatchesList> groupslist = new List<PatchesList>();
log.LogInformation($"C# Queue trigger function processed: {grouprows}");
foreach (var c in grouprows.Results)
{
groupslist.Add(new PatchesList
{
RowKey = c.RowKey,
Name = c.Name
});
log.LogInformation($"C# Queue trigger function processed: {groupslist[0].Name}");
}
return groupslist;
}
public class PatchesList : TableEntity
{
public string PartitionKey { get; set; }
public string RowKey { get; set; }
public string Name { get; set; }
}
I am having trouble sending data back and Is this approach feasible, can Queue Trigger send back response?