Desired flow:
- HTTP Request to insert data into a table in azure storage. Currently using Postman and localhost. Note: This is running sucessfully and it is step 2 I'm struggeling with. <-- Azure Function
- When data rows is stored in a table here (tablename = Test) as datatype String, I want to query the data by using a console application. <-- Console Application (se code below)
Please also look at my comment in the code for my two questions.
Q1) What should storageConnectionString be when I'm only running this locally in the emulator in order to connect to my local table?
Q2) How can I now query all the content in the table or for example row 15 using LINQ and store it in an variable, and print it to console window?
using System;
using System.Threading.Tasks;
using Microsoft.Azure.Cosmos.Table;
namespace demo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Table storage sample");
var storageConnectionString = "??"; // What should storageConnectionString be when I'm only running this locally in the emulator?
var tableName = "Test";
CloudStorageAccount storageAccount;
storageAccount = CloudStorageAccount.Parse(storageConnectionString);
CloudTableClient tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration());
CloudTable table = tableClient.GetTableReference(tableName);
}
}
//How can I now query all the content in the table or for example row 15 using LINQ and store it in an variable, and print it to console window?
}
POCO
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Cosmos.Table;
namespace LokalTesting.TableEntities
{
public class Test: TableEntity
{
public Test()
{
}
public Test(string NameId)
{
PartitionKey = NameId;
RowKey = NameId;
}
public string NameId { get; set; }
public string Status { get; set; }
public string RoutingId { get; set; }
Desired output:
-All rows where NameId = Jon