Skip to main content

Azure Table Storage - Get


Back - Azure > Azure Storage

The Requirement
Assuming that we already completed the 1.1 Create/Add Azure Table Storage Entity, We now need to implement a get to the data store to consume by our front end framework.To achieve this requirement, We are planning to use ASP.Net Web Api through normal Http Get. These web api will be called from our front end framework such as Angular or Knockout for example.Our mission is to create the data access strategy and embed the layer into our Web Api solution

Consideration
This code base is proposed for the intention for understanding its usage, for production/release we might need to tweak it to meet the company policy, best practice and industry standards.

The Data Store Information Needed
To use an Azure Table Data Storage, we need 2 key information regarding our data store.
1. The Azure Storage Name - In this Example we name it as OurCMSStorage
2. The Azure Storage Table Access Key - Each Azure Storage will have their own key, we will be able to find it through the Azure Portal

Establish A Connection To The Data Store
Before we started to inject anything to the data store, we need to establish a connection to the data store using the 2 key information above. This can be done using the snippet code below.

Create A Table Client
Since we are the client who wanted to access the data store, we need to instantiate a TableClient class to perform all our CRUD actions against the data store. We also need to notify which table that we are referring to and create one if we believe that it might not exist yet.below are the code snippet to perform the algorithm.

The Get Query
To query our data against our table, we need a query to filter out which data that we wanted to pull out from the data store, we will be using a TableQuery class to perform such action.

Finally - Execute the Get Query
Finally to open a connection and get the data we will use the Table.Execute Command and populate the data as IEnumabrable of SplashBannerAzure . Conclusion

From the article we may summarize in order to perform a CRUD-Get to Azure Storage table, we require some information on the Azure Storage Table details and we also need to instantiate some classes such as to perform the tasks before finally execute the data get operation.

Back - Azure > Azure Storage

Published on : 6-May-2018
Ref no : DDN-WPUB-000014

About Author

My photo
Wan Mohd Adzha MCPD,MCSD,MCSE
I am passionate about technology and of course love Durians. Certified by Microsoft as MCP Since 2011. Blogging from Malaysia

Comments