Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to get an Azure Storage Table Entity by it's partition key and row key.
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
public object GetEntity(string partitionKey, string rowKey)
{
CloudStorageAccount account = GetAccount();
CloudTableClient cloudTableClient = account.CreateCloudTableClient();
CloudTable table = cloudTableClient.GetTableReference("YourTableName");
TableOperation retrieveOperation = TableOperation.Retrieve(partitionKey, rowKey);
TableResult retrievedResult = table.Execute(retrieveOperation);
return retrievedResult.Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment