In this article, we will see how to retrieve records from an Azure Table Storage. Before working with this demo, I have already added two more records to our table in the same partition called Customer1 and Customer2,
- Creating Storage Account and Table - Understanding Table Storage - Part One
- Inserting Records -Understanding Table Storage - Part Two
- Updating Records -Understanding Table Storage - Part Four
- Batch Table Operations-Understanding Table Storage - Part Five
- Deleting Records -Understanding Table Storage - Part Six
Step 1
First, we are going to see how to retrieve a single record from the table. Open your project, remove or comment the method call and method for creating the customer that we did in the previous exercise and add the following method RetriveCustomer, with parameters, CloudTable, PartitionKey and the RowKey to uniquely identify the customer to your class.
- public static void RetrieveCustomer(CloudTable table, string partitionKey, string rowKey)
- {
- TableOperation tableOperation = TableOperation.Retrieve<Customer>(partitionKey, rowKey);
- TableResult tableResult = table.Execute(tableOperation);
- Console.WriteLine(((Customer)tableResult.Result).CustomerName);
- }
Add the method call code to your Main method after the code for getting table reference.
- RetrieveCustomer(table, "registered", "[email protected]");
- Console.ReadKey();

Hadshana KamalanathanPosted Jul 14, 2018, 11:42 PM
Thank you for sharing...