Created
April 13, 2015 00:30
-
-
Save gbellmann/99d3cf405fe857480e89 to your computer and use it in GitHub Desktop.
Function to get an Azure Storage Table Entity by it's partition key and row key.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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